开发者

set pages main html tag in c#

开发者 https://www.devze.com 2023-03-06 20:23 出处:网络
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:

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

精彩评论

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