“<” in a text box in ASP.NET --> how to allow it?

前端 未结 7 2091
粉色の甜心
粉色の甜心 2020-12-01 18:24

I have a textfield which displays a string which contains < and >. The code throws an error because of that. How can I allow the usage of those chars in my textfield?

7条回答
  •  再見小時候
    2020-12-01 19:23

    You can either use the TextBox.Text property which will HTML-encode whatever you enter

    
    

    or you can enter the html names for < and >.

    <
    

    or you can enter the html codes

    <
    

    for the name and code conversions, check out this chart.

提交回复
热议问题