user configurable refresh time

Reply

Join Date: Feb 2006
Posts: 399
Reputation: chris5126 is an unknown quantity at this point 
Solved Threads: 14
chris5126 chris5126 is offline Offline
Posting Whiz

user configurable refresh time

 
0
  #1
Apr 19th, 2009
Hi,

I have a site and I want the user to be able to select the refresh time. I set it on page load:
  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:

  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?
If my post helped add to my rep!
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 59
Reputation: FaridMasood is an unknown quantity at this point 
Solved Threads: 0
FaridMasood's Avatar
FaridMasood FaridMasood is offline Offline
Junior Poster in Training

Re: user configurable refresh time

 
0
  #2
May 25th, 2009
add not post back condition in page load

like this

  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.
Thanks and Best of Lusk,

Farid ud din Masood
MS.c (CS)
University of Agriculture, Faisalabad
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC