How do you set up a CSS switcher to run your website in a browser?
<head>
<link id="linkStyles" rel="stylesheet" type="text/css" runat="server" />
</head>
protected void Page_Load(object sender, EventArgs e) {
string stylesheetAddress = // logic to determine stylesheet
linkStyles.Href = stylesheetAddress;
}
Tags: html javascript css asp.net
Source: By Jon Galloway as answer to the question
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 4.0
Related code-snippets:
- Why did the width collapse in the percentage width child element in Internet Explorer 7?
- Which timezone is most important?
- Multiple submit buttons in HTML form.
- How can I sync my SVN revision number with my ASP.NET web site?
- How can I print an HTML document from a web service?
- What is the catch all algorithm?
- How do I know which font has been used in Web page?
- How to break word after special character like Hyphens (-)?
- What is the value of built, encoded viewstate?
- ASP.Net Custom Client-Side Validation. ASP.Net has created thousands of Web Application Test cases.
- What do I do with triple quotes? How do I delimit a databound Javascript string parameter in ASP.NET?
- Can multiple dataContext classes be a good use of data?
- How do I make a checkbox toggle from clicking on the text label as well?
- How do I define custom web.config sections with potential child elements and attributes for the properties?
- How do you change a master page background to the code behind your content page?