Solved

Dynamically applying skins to user controls in asp.net 2.0

Posted on 2009-05-15
3
369 Views
Last Modified: 2012-05-07
How to change the skin of controls in my user control dynamically?
0
Comment
Question by:priyanka_kothari
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Expert Comment

by:tetorvik
ID: 24394336
you'll need to do it in Page_PreInit event like:
*.ascx.cs   
    void Page_PreInit(object sender, EventArgs e)
    {
        Calendar1.SkinID = "MySkin";
    } 

Open in new window

0
 

Author Comment

by:priyanka_kothari
ID: 24394691
I have done the same but its not working. I am using login control and want to change skin of login controls' controls
0
 
LVL 9

Accepted Solution

by:
tetorvik earned 500 total points
ID: 24399942
I have to admit i haven't been playing around with login control too much. But quickly looking at it, I managed to change control appearance by applying skinid dynamically. This is what I did:

1:converted the login control to template (http://msdn.microsoft.com/en-us/library/ms178340.aspx) to see what control ids the controls in login control have. (you can also do this without converstion, but then you'll need to find another way around to find the controls you're intrested)
2:on Page_PreInit :
   this.Login1.FindControl("UserNameLabel").SkinID = "mySkin";
3: remember to have the theme set up correctly on your page
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question