473,406 Members | 2,371 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,406 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 1803
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.