ASP.net render meta tag validly

后端 未结 2 1384
没有蜡笔的小新
没有蜡笔的小新 2021-01-21 16:57

HTML:


Codebehind:

MetaDescription.Attr         


        
2条回答
  •  旧巷少年郎
    2021-01-21 18:01

    You should remove the id property from the , this means the control won't be accessible from the server side by id but instead of it it could be dynamically created and then added to the page:

    HtmlMeta meta = new HtmlMeta();
    meta.Name = "keywords";
    meta.Content = ThisBlog.MetaDescription;
    this.Header.Controls.Add(meta);
    

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题