Asp:Textbox vs input text (a PHP Developer learning ASP)

后端 未结 3 1477
刺人心
刺人心 2021-02-19 01:59

I’ve been a PHP developer for 10 years, trying to broaden my horizon I am doing a project in ASP.NET. What is the advantage to using an over usi

3条回答
  •  清歌不尽
    2021-02-19 02:42

    You can add a runat="server" attribute to any regular HTML tag in ASP.NET WebForms and it will be available to you in code behind as an HtmlGenericControl. You can set the text via HtmlGenericControl.InnerText and the HTML via HtmlGenericControl.InnerHTML.

    An advantage of using an ASP.NET TextBox is you can have it render as an or as a