Dynamically changed the CSS style

xiaoxiao2021-03-06  41

In ASP.NET, sometimes dynamically transform CSS, such as sometimes doing personalized pages, you can do this , in the page to replace the CSS, use the following code SUB Page_LOAD (Sender As Object, EVENTARGS) if not (ispostback) MyStylesheet.attributes.add ("href", "/ CSS / FLOSTYLE.CSS ") Endness Sub See how to set up online in C #

Below this must be placed between // Define protected in .cs file System.Web.ui.htmlControls.htmlGenericControl CSS1; Write css1.attributes.add ("href", "/ css / flostyle.css" in Page_Load!

转载请注明原文地址:https://www.9cbs.com/read-78460.html

New Post(0)