In maste page i set the stylesheet that defines the layout.
<link id="layoutStylesheet" href="CSS/Layout3Col.css" rel="stylesheet" type="text/css" runat="server" />
I have a ShowDoc.aspx page that inherits the master page.
I want to load a different css file when a specific parameter is passed to ShowDoc.aspx in query string.
How can I do it?
Should I define a public property in the master page so that showDoc.aspx can access it and change the layoutStylesheet ?
You could find the stylesheet link using the Master property on the ShowDoc page in Page_Load and redefine the Href property there.
HtmlLink link = Page.Master.FindControl( "layoutStyleSheet" ) as HtmlLink;
link.Href = ...your chosen stylesheet...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With