Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 31-07-2009
Member
 
Join Date: Oct 2008
Posts: 75
How to write script to page reload in ASP

How one can write an script to reload the page in ASP.Net, for more details, i wanted to format the page where i want to provide the Button which should Reload the page this will help the user to not to go anywhere on the Browser they would get the button on their existing page.
Reply With Quote
  #2  
Old 31-07-2009
Member
 
Join Date: Jan 2009
Posts: 143
Re: How to write script to page reload in ASP

You need to use the following methods to reload and refresh the page, YOu could have the same page be separated. one loads the blank html form. when it submits have it submit to itself. and detect for data in some fields or a variable. DataBind the other control on the OnButtonClick event for the update button.

function doLoad()
{
// make sure to timeout value should be the same as in the "refresh" meta-tag
setTimeout( "refresh()", 3*1500 );
}

function refresh()
{
// This version of the refresh function will cause a new
// entry in the visitor's history. It is provided for
// those browsers that only support JavaScript 1.0.
//
window.location.href = sURL;
}
Reply With Quote
  #3  
Old 31-07-2009
Member
 
Join Date: Jan 2006
Posts: 211
Re: How to write script to page reload in ASP

One way to handle this could be using Bubble events. You can create a bubble event and call it from within each user control tab to rebind that data. If you use Response.Redirect() there is an options to end response by setting a boolean value. You might want to take a look at this.

<body onload="timer=setTimeout('move()',2000)">

In the above example of JavaScript that will reload a page in 3 seconds. See timer=setTimeout('move()',2000) 2000 will be the counter number of milliseconds which equals to 2 seconds. after it gets complete the page will be refreshed.
Reply With Quote
  #4  
Old 31-07-2009
Member
 
Join Date: Mar 2008
Posts: 335
Re: How to write script to page reload in ASP

I think you are making it a bit to complicated for yourself and i presume you don't need to reload every page that uses the header.asp include. You need to simply add a metarefesh tag to execute the code if the variable matches first load, else just display the page. It defines multiple JavaScript code blocks, where each JavaScript version block redefines the same function.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to write script to page reload in ASP"
Thread Thread Starter Forum Replies Last Post
How to setup automatic timed page reload Webpages in Firefox? Corry Technology & Internet 5 03-02-2010 01:34 PM
Update a page content without reload Cabexas Software Development 3 07-11-2009 09:42 PM
Facebook page reload error PinkShell123 Technology & Internet 3 03-11-2009 10:19 PM
How to force a complete reload of a page in asp.net Integer Software Development 3 17-03-2009 11:55 PM
Reload web page without clearing cache in firefox PsYcHo 1 Tips & Tweaks 1 27-11-2008 05:13 PM


All times are GMT +5.5. The time now is 08:50 PM.