ASP.net to send text with enter

Asked

Viewed 54 times

3

in Example.aspx.Cs

protected void Page_Load(object sender, EventArgs e)
    {
      teste0989.InnerText="teste123<br>teste456<br>"
    }

in the site appears the br as text and actually wanted to enter some suggestion

1 answer

4

I believe what you seek is this:

protected void Page_Load(object sender, EventArgs e)
{
   teste0989.InnerHtml="teste123<br>teste456<br>"
}

the InnerText already escapes the special characters to be displayed as text. The solution is to switch to InnerHtml.

Browser other questions tagged

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