bring html code from the bank

Asked

Viewed 342 times

0

I have the following question, I know I am not doing it the right way, but I believe it will serve me. I’m trying to integrate my College project with Pagseguro, but I’m finding it complex to use the API, but I saw that in Pagseguro we have the possibility to use buttons generated by the site, and these are in HTML. My system has the product that has several values, and in this case for each product would have to be generated a button, because in Pagseguro to generate the precise button must enter the product name and value to then be generated a code for this button. then for each value, it would generate a button, and then this code would be stored in the database, and when the Index displayed the products, it wanted to take this HTML code from the database and display on the screen, however in its button function, but so far, it can display only HTML

inserir a descrição da imagem aqui

the right thing would be

inserir a descrição da imagem aqui

in the view, I’m using

<i>@Html.DisplayFor(modelItem => item.Botao)</i>
  • 2

    I reversed your issue because you are changing the essential points of a question that has already been answered, and marked as accepted. If you have new doubt, the correct thing is to ask a separate question. If it’s just a small adjustment, you can leave a comment in @Ricardo’s reply asking for help or an add-on, avoiding the need for a new question.

  • 2

    PS: if you and @Ricardo agree that the modification does not invalidate the answer given, just use the history at http://answall.com/posts/161900/revisions to recover the changed data, without prejudice.

1 answer

3


If the code coming from the bank is the same as the one you posted in the first image, you need to do Code and use Html.Raw of Razor, thus:

<i>    
   @Html.Raw(HttpUtility.HtmlDecode(Model.Botao));
</i>

I always play the content inside an element div, what helps in formatting.

  • worked part, but he displayed this message System.Web.Mvc.Htmlhelper`1[System.Collectio above the button. I will show the image

  • Your html contains a tag form, there is some other tag form on your page, or Html.BeginForm() ?

  • entered the source code in the reply...

  • I already found the error, I had a @html lost there on the button, while I was editing the code I deleted a content without noticing, and now everything is normal. Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.