Understanding the runat server attribute

前端 未结 4 863
时光取名叫无心
时光取名叫无心 2020-12-03 02:13

I\'m really new to ASP.NET. I was just checking out a default ASP.NET web application. It comes by default with a few pages (Default.aspx, About.aspx etc).

I notice

4条回答
  •  一个人的身影
    2020-12-03 02:47

    The runat attribute basically tells ASP.Net that it needs to parse the element, its attributes and it's contents as a server control. Enabling code, on the server, to be executed to configure the response.

    Without it, any child controls contained within the section will not get parsed. So, any dynamic header includes, title manipulations or any other server-controls will not be interpreted.

提交回复
热议问题