473,327 Members | 2,094 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,327 software developers and data experts.

Response.Write and Response.Redirect

On my Page_Load event, i need to do some validation and then either let
them proceed, or display a error message and boot them back to the
previous page. Here is the code:

Response.Write("<script>alert('Error Message here');</script>");
Response.Redirect("Configuration.aspx");

Problem is that if I call Response.Redirect to move them to the previous
page, the Response.Write gets eaten. How do I solve this issue?
thanks!

Nov 17 '05 #1
4 19306
You have to response.write some javascript to do the redirect client side.

"Matthew Wieder" <De*********@SatoriGroupInc.com> wrote in message
news:3F**********@SatoriGroupInc.com...
On my Page_Load event, i need to do some validation and then either let
them proceed, or display a error message and boot them back to the
previous page. Here is the code:

Response.Write("<script>alert('Error Message here');</script>");
Response.Redirect("Configuration.aspx");

Problem is that if I call Response.Redirect to move them to the previous
page, the Response.Write gets eaten. How do I solve this issue?
thanks!

Nov 17 '05 #2
What javascript would that be?
thanks!

Marina wrote:
You have to response.write some javascript to do the redirect client side.

"Matthew Wieder" <De*********@SatoriGroupInc.com> wrote in message
news:3F**********@SatoriGroupInc.com...
On my Page_Load event, i need to do some validation and then either let
them proceed, or display a error message and boot them back to the
previous page. Here is the code:

Response.Write("<script>alert('Error Message here');</script>");
Response.Redirect("Configuration.aspx");

Problem is that if I call Response.Redirect to move them to the previous
page, the Response.Write gets eaten. How do I solve this issue?
thanks!



Nov 17 '05 #3
I got it. For those interested:
Response.Write("<script>location.href = WebPage.aspx';</script>");

thanks for the help.

Matthew Wieder wrote:
What javascript would that be?
thanks!

Marina wrote:
You have to response.write some javascript to do the redirect client
side.

"Matthew Wieder" <De*********@SatoriGroupInc.com> wrote in message
news:3F**********@SatoriGroupInc.com...
On my Page_Load event, i need to do some validation and then either let
them proceed, or display a error message and boot them back to the
previous page. Here is the code:

Response.Write("<script>alert('Error Message here');</script>");
Response.Redirect("Configuration.aspx");

Problem is that if I call Response.Redirect to move them to the previous
page, the Response.Write gets eaten. How do I solve this issue?
thanks!



Nov 17 '05 #4
Just one additional thing. Using Response.Write() is dodgy at best with
ASP.Net. Try using Page.RegisterStartupScript() instead.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"Matthew Wieder" <De*********@SatoriGroupInc.com> wrote in message
news:3F**************@SatoriGroupInc.com...
I got it. For those interested:
Response.Write("<script>location.href = WebPage.aspx';</script>");

thanks for the help.

Matthew Wieder wrote:
What javascript would that be?
thanks!

Marina wrote:
You have to response.write some javascript to do the redirect client
side.

"Matthew Wieder" <De*********@SatoriGroupInc.com> wrote in message
news:3F**********@SatoriGroupInc.com...

On my Page_Load event, i need to do some validation and then either let them proceed, or display a error message and boot them back to the
previous page. Here is the code:

Response.Write("<script>alert('Error Message here');</script>");
Response.Redirect("Configuration.aspx");

Problem is that if I call Response.Redirect to move them to the previous page, the Response.Write gets eaten. How do I solve this issue?
thanks!

Nov 17 '05 #5

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

Similar topics

3
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
3
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
3
by: Jed | last post by:
I have written an HttpHandler which I invoke through an ashx page. The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page. Everything...
1
by: Kevin Blount | last post by:
Background: My script is designed to only allow the downloading of a file if a cookie exists to say that someone is logged into my companies site. A colleague set up a test area the extension...
12
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.