bring html code from the bank

0

I have the following doubt, I know I'm not doing it the right way, but I believe it will do me good. I'm trying to integrate my College project with Pagseguro, but I'm finding it complex regarding the use of 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 the Pagseguro to generate the button must necessarily insert the name of the product and value to then be generated a code for this button. then for each value would generate a button, and then this code would be stored in the database, and when the Index displayed the products, I wanted to get this HTML code from the database and display on the screen, but in its button function, but until the moment, I was only able to display HTML

Thecorrectonewouldbelikethis

In the view, I'm using

<i>@Html.DisplayFor(modelItem => item.Botao)</i>
    
asked by anonymous 28.10.2016 / 05:35

1 answer

3

If the code that comes from the database is the same as the one you posted in the first image, you need to decode and use Html.Raw of Razor , like this:

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

I usually always play content inside a div element, which helps in formatting.

    
28.10.2016 / 11:26