how to load the themes dynamically?

Posted by Krishnamanohar under ASP.NET on 4/22/2013 | Points: 10 | Views : 780 | Status : [Member] | Replies : 1
hi Experts ,
how to load the themes dynamically?
send me code pls
Thanks in advance
Krish




Responses

Posted by: kgovindarao523-21772 on: 4/22/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
you can set page themes in page pre_int method only.

Aspx Code:

<asp:Label ID="Welcome To" runat="server" Text="Welcome To"></asp:Label><br />
<br />
<asp:Label ID="DotNetFunda" runat="server" Text="PRIME !!"></asp:Label><br />
<br />
<asp:Button ID="Change" runat="server" Text="Check Me" OnClick="Change_Click" /><br />
<br />
<asp:DropDownList ID="ColorList" runat="server" OnSelectedIndexChanged="colorModelItemDdl_SelectedIndexChanged"
Width="145px" AutoPostBack="true">
<asp:ListItem Selected="True" Value="Black">--Choose color--</asp:ListItem>
<asp:ListItem Value="Blue"> Blue</asp:ListItem>
<asp:ListItem Value="Green"> Green</asp:ListItem>
<asp:ListItem Value="Red"> Red</asp:ListItem>
</asp:DropDownList>

cs code:

protected void Page_Load(object sender, EventArgs e)
{

}

protected void colorModelItemDdl_SelectedIndexChanged(object sender, EventArgs e)
{
Session["asp"] = ColorList.SelectedValue;
}

protected void Page_PreInit(object sender, EventArgs e)
{
if (Session["asp"] != null)
{
Page.Theme = Session["asp"].ToString();
}
}
protected void Change_Click(object sender, EventArgs e)
{
}

please mark as answer if this post is helpfull to you.

Thank you,
Govind

Thank you,
Govind

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

Login to post response