How to use ASP tags with Stringbuilder

Asked

Viewed 26 times

0

People I am using Sringbuilder to assemble a page in ASP.NET jpa I did it several times without problems, but now I need to assemble a string that has tas ASP inside it, mount is not the problem but the page does not work.

I’m doing it this way :

Dim sb As New StringBuilder()

    sb.AppendLine("<div class=""col-lg-2 col-md-2 col-sm-3 col-xs-4"">")
    sb.AppendLine("<img class=""img-responsive"" src=""imagens/208/1005/Clientes.png""/>")
    sb.AppendLine("<asp:ImageButton ID=""ImageButton1"" runat=""server"" ImageUrl=""~/Imagens/Icon-trash2.png"">")
    sb.AppendLine("</div>")

    comandos.Text = sb.ToString

But the HTML it generates is giving error (See below)..

inserir a descrição da imagem aqui

Can someone help me with this...? Thank you

  • what would be the error? the </div> in red?!

  • Actually not only that... notice that the browser has rendered an ASP.Net command (Asp:Imagembutton) and this command the browser does not recognize...

  • i didn’t quite understand the problem, but Voce has tried using @ at the beginning? Sb.Appendline(@"<div

No answers

Browser other questions tagged

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