简体   繁体   中英

How to change a SKIN in all pages

I have a web project in which I use Theme and Skin to form my pages, today I decided to change some skins for some elements in my application.

Up to now I had a single skin for my buttons

<asp:Button SkinID="Button" CssClass="Button" runat="server" />

Now I want to change it for some of my buttons like

<asp:Button SkinID="SubmitButton" CssClass="Button Submit" runat="server" />
<asp:Button SkinID="DeleteButton" CssClass="Button Delete" runat="server" />
<asp:Button SkinID="CancelButton" CssClass="Button Cancel" runat="server" />

Allof my buttons implemented like

<asp:Button ID="btnDelete" SkinID="Button" runat="server" />
<asp:Button ID="btnSubmit" SkinID="Button" runat="server" />
<asp:Button ID="btnCancel" SkinID="Button" runat="server" />
<asp:Button ID="btnOtherActivities" SkinID="Button" runat="server" />

Now I want to use a regular expression to change the SkinID of my controls to each equevalents

What Can I do?

set up your theme inside your web.config file;

<configuration>
    <system.web>
        <pages theme="ThemeName" />
    </system.web>
</configuration>

if your can set up the same skinid names inside your new theme, those will be changed automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM