how change run time CSS using Master page and only administrer can change

Posted by Sagarp under Regular Expressions on 11/4/2009 | Views : 3878 | Status : [Member] | Replies : 2
HI

i will do to change run time css in ASP.net using Master page.when i Select in Dropdown list option that color of Css apply without using .net Them.reply me.but dropdown list on view to administer not for all user.only Administer can select css from dropdownlist


Thanks

Sagar

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/



Responses

Posted by: Vuyiswamb on: 11/4/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down


lookat this

http://www.aspcode.net/Dynamically-select-CSS-in-ASPNET.aspx


http://www.codeproject.com/KB/aspnet/ASPNET_Dynamic_Styling.aspx

http://www.codeproject.com/KB/aspnet/setcssfilelink.aspx

Thank you for posting at dotnetfunda

Thank you for posting at Dotnetfunda
[Administrator]

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakhangarg on: 11/4/2009 [Member] [Moderator] Silver

Up
0
Down
Hi Sagarp-

on Seleted index change Event of DropDownLIst call the page again using server.transfer or response.redirect. pass the new settings either in Querystring or save that value in session variable .
For Example:
Your Class Name is:
BlueGlass
RedClass
GreenClass etc.
by default green is Implemented
Now you want to implement Blue Calss.

when you will choose blue from Dropdownlist.
OnSelectedIndexChanged Event use this:

Response.Redirect("YourPage.aspx?class=blue");

Now on Page Load Check:

className="GreenClass";

if (Request.QueryString["class"]!=null)
{
if(Request.QueryString["class"].ToString()=="blue")
className="BlueClass";
else if(Request.QueryString["class"].ToString()=="red")
className="RedClass";
}
Page.RegisterStartupScript('css',"SetCSS('"+ className +"');");

Create javscript function

function SetCSS(cssname)

{
// Set you css Here;
}


Thanks & Regards

Lakhan al Garg

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response