Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Dynamically applying skins to user controls in asp.net 2.0

How to change the skin of controls in my user control dynamically?
0
priyanka_kothari
Asked:
priyanka_kothari
  • 2
1 Solution
 
tetorvikCommented:
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
 
priyanka_kothariAuthor Commented:
I have done the same but its not working. I am using login control and want to change skin of login controls' controls
0
 
tetorvikCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now