943,960 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 1307
  • ASP RSS
Apr 19th, 2009
0

user configurable refresh time

Expand Post »
Hi,

I have a site and I want the user to be able to select the refresh time. I set it on page load:
ASP Syntax (Toggle Plain Text)
  1. void Page_Load(Object sender, EventArgs e)
  2. {
  3. Response.AppendHeader("Refresh", "10");
  4. }

Then the user can change it via a drop down list. In the list changed I put:

ASP Syntax (Toggle Plain Text)
  1. protected void RefreshTime_SelectedIndexChanged(object sender, EventArgs e)
  2. {
  3. string refreshtime = RefreshTime.AutoPostBack.ToString();
  4. RefreshTime.Items.FindByValue(refreshtime).Selected = true;
  5. Response.AppendHeader("Refresh", ""+refreshtime+"");
  6. }
I hoped it would save the new value but it always defaults back to the original value. I even moved the code from page_load to page_init no difference. Any ideas where im going wrong?
Reputation Points: 38
Solved Threads: 15
Posting Pro in Training
chris5126 is offline Offline
412 posts
since Feb 2006
May 25th, 2009
0

Re: user configurable refresh time

add not post back condition in page load

like this

ASP Syntax (Toggle Plain Text)
  1. if(!IsPostBack)
  2. {
  3. Response.AppendHeader("Refresh", "10");
  4. }
Last edited by peter_budo; May 26th, 2009 at 6:56 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 8
Solved Threads: 0
Junior Poster in Training
FaridMasood is offline Offline
59 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: PayPAl IPN Post
Next Thread in ASP Forum Timeline: Converting an IIS wepage to a mobile page





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC