If your application targets different user-groups, you may feel the need to customize the layout of the page to display group-specific visual interface. This can be achieved by using customized CSS files that are added dynamically.
You can add CSS files in to ASP.NET webpages dynamically. Let me show you how.
Add following HTML tag in the ASP.NET (.aspx) page in the header section. <link id=”CSSFile” type=”text/css” rel=”Stylesheet” runat=”server” />
In the code behind page you can then add the CSS file as follows by accessing the link ID CSSFile.Attributes.Add(“href“, “Dynamic.css“)(Dynamic.css is the CSS file that has been added to the page.)