How to use ASP.NET <%= tags in server control attributes?

后端 未结 7 1518
陌清茗
陌清茗 2020-11-28 10:15

This works:

\" />

This doesn\'t work:

         


        
7条回答
  •  攒了一身酷
    2020-11-28 10:46

    is compiling at runtime and converting to html tags. You can set text with codebehind or like this:

    
    <% Text1.Text = this.Text;%>
    

    UPD: Seems like my variant doesnt work, this is better:

    protected void Page_Load(object sender,EventArgs e) 
    {
        Text1.Text = this.Text;
    }
    

提交回复
热议问题