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";
精彩评论