开发者

set pages main html tag in c#

I am writing a .net c# website w开发者_如何学编程hich is available in multiple languages. How can I set the following main html tag in code behind of a page:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Is this possible?


Sure, just add an id and runat=server to your HTML tag in your page:

<html id="html" runat="server" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

Then in your code behind you can set whatever you'd like:

    html.Attributes["xml:lang"] = "somethingelse";
    html.Attributes["lang"] = "somethingelse";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜