473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Refreshing a page programatically

HI all,

Does anyone know how I can make a page refresh itself programatically if a
given event is fired.

I thought there would be some method like doPostBack() or something but I
can't see anything like that

Thanks

All

Simon
Nov 18 '05 #1
3 1802
Hi there,

Thanks for your help.

One thing I'm wondering about what you suggest is if this approach to the
problem would result in the same type of refresh as a postback. For example,
what would happen with the viewstate?

Thanks again

Simon
Nov 18 '05 #2
Response.Redirect is used to direct the web page somewhere
Request.ServerVariable["SCRIPT_NAME"] is a Server Variable that holds the
path used to access the web page
eg /WebApplication1/WebForm1.aspx
the / Forces it to go to the root directory thus it will reload itself

Response.Redirect(Request.ServerVariables["SCRIPT_NAME"]);
return;
The above code forces a page to reloads itself. Just be careful where you
put it otherwise you will end up in a never ending loop ;)
As a general rule you should also put a return; right after the code so no
other code accidentally gets executed.

Hope this helps.
This posting is provided as is.

"Simon Harvey" <si**********@the-web-works.co.uk> wrote in message
news:OT****************@TK2MSFTNGP11.phx.gbl...
HI all,

Does anyone know how I can make a page refresh itself programatically if a
given event is fired.

I thought there would be some method like doPostBack() or something but I
can't see anything like that

Thanks

All

Simon

Nov 18 '05 #3
Hi there,

Thanks for your help.

One thing I'm wondering about what you suggest is if this approach to the
problem would result in the same type of refresh as a postback. For example,
what would happen with the viewstate?

Thanks again

Simon
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marcia Gulesian | last post by:
Is there a way of reloading a page programatically - for example, <script language="javascript> document.location.reload() </script> BUT NOT HAVING TO MANUALLY CLICK A "RESET" BUTTOM.
31
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and...
1
by: Simon Harvey | last post by:
HI all, Does anyone know how I can make a page refresh itself programatically if a given event is fired. I thought there would be some method like doPostBack() or something but I can't see...
3
by: markeboy | last post by:
I am wanting to control when a page is loaded using a separate class to manage when and how it should be loade My current implementation needs to set a property of the page programatically...
6
by: Mythran | last post by:
I have 2 projects, a Web project and a Class Library project. In the class project, I have a class called Class1. Pseudo below: Class Class1 ... Public Static Sub Generate() If True '...
2
by: Ben | last post by:
Hi, One ASP.NET transactional page conducts a long transaction in a button click function. I want to display the transaction progress info in label control without refreshing page. It is...
0
by: ravi | last post by:
Hi, I am getting problem on refreshing page, when i close child window ..here i am not using button to close window just clicking on top of the page above cross singn to close window .
1
by: viral123 | last post by:
Hi all I have created one dropdown list box which contains all the employee name. By selecting the name from that list, it returns the details of that particular employee from the database. It...
2
by: madhu7sudan | last post by:
hi In a whole page i have one box and in that box there are many name ( like 1000) and i have display only 10 names and a link button more if i press on that linkbutton it shold display the...
3
by: manuitpro | last post by:
Hi All, I have page with many tabs, in one of the tab i have a form (only a input box) and i want to show some output on the same tab view based on the user input. (bvy using php function) I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.