Posts head tag has a runat=-server- attribute
Post
Cancel

head tag has a runat=-server- attribute

source - http://stackoverflow.com/a/11510589

The head element contains a runat=”server” attribute, which indicates that it is a server control (rather than static HTML). All ASP.NET pages derive from the Page class, which is located in the System.Web.UI namespace. This class contains a Header property that provides access to the page’s region. Using the Header property we can set an ASP.NET page’s title or add additional markup to the rendered section. It is possible, then, to customize a content page’s element by writing a bit of code in the page’s Page_Load event handler.

1
2
3
4
5
6
7
        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlMeta x=new HtmlMeta();
            x.Name = "keywords";
            x.Content = "master page,asp.net,tutorial";
            Page.Header.Controls.Add(x);
        }

snap003

snap002

origin - http://www.pipiscrew.com/?p=2053 head-tag-has-a-runatserver-attribute

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags