Reputation: 44615
I am writing a .net c# website which 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?
Upvotes: 0
Views: 1216
Reputation: 1355
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";
Upvotes: 1