TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Majid Kamali
NA
290
256.3k
Problem with asp button postback
Jun 26 2011 12:54 PM
Hi.
I have four buttons for changing stylesheet with IDs BTN_RED, BTN_GREEN, BTN_BLUE, BTN_YELLOW.
When I click one of them, I want to post back to this page while theme is changed.
I want to change href attribute of stylesheet, to corresponding stylesheet.
Here's master page cs file: (LINK_StyleSheet is id of link tag in header)
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Theme"] == null)
LINK_StyleSheet.Href = "~/Styles/blue.css";
else
LINK_StyleSheet.Href = Session["Theme"].ToString();
}
protected void BTN_RED_Click(object sender, EventArgs e)
{
Session["Theme"] = "~/Styles/red.css";
}
and also for three other buttons.
But site theme will change when I click a single button two times.
First time I click a button, it does not change the theme. second time, I click that, it will change.
What's the problem.
Reply
Answers (
2
)
Which control csharpcorner use for get Post and article from user.
How to get list view checkbox selected items in windows mobile app?