473,609 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.Write and Response.Redire ct

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.Redire ct("Configurati on.aspx");

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

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

"Matthew Wieder" <De*********@Sa toriGroupInc.co m> wrote in message
news:3F******** **@SatoriGroupI nc.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.Redire ct("Configurati on.aspx");

Problem is that if I call Response.Redire ct 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*********@Sa toriGroupInc.co m> wrote in message
news:3F******** **@SatoriGroupI nc.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.Writ e("<script>aler t('Error Message here');</script>");
Response.Redi rect("Configura tion.aspx");

Problem is that if I call Response.Redire ct 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>locati on.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*********@Sa toriGroupInc.co m> wrote in message
news:3F******** **@SatoriGroupI nc.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.Redire ct("Configurati on.aspx");

Problem is that if I call Response.Redire ct 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.RegisterSt artupScript() 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*********@Sa toriGroupInc.co m> wrote in message
news:3F******** ******@SatoriGr oupInc.com...
I got it. For those interested:
Response.Write( "<script>locati on.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*********@Sa toriGroupInc.co m> wrote in message
news:3F******** **@SatoriGroupI nc.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.Redire ct("Configurati on.aspx");

Problem is that if I call Response.Redire ct 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
3898
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 "http://www.domain2.com/VDIR2/table.asp" & "?PubID=" & PubID & "&PubName=" & PubName The query string is data to open a DB. the page displays
3
2811
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 Session("UserType") = "Sales". Then based on the Session("UserType") I use response.redirect to take the user to a specific page. The logic and response.redirect works fine on a Win2k server but when I move the page to a server running Win2003 the...
13
4732
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 Response.Writes. Are there any tools that will let you design the form then convert that form to Response.Writes that you can further customize with ASP logic? For instance: use Dreamweaver to design the form, then another program to convert to...
3
818
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 is the code: If (sServiceCenter = "*ALL") Then sServiceCenter = "%"
3
7954
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 up to the redirect works fine, but I can't get the redirect to work. If I do a ... context.Response.Write("Hello World"); .... the HttpHandler works great and the browser loads the text fine, but if I change it to ...
1
1625
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 .EXE is associated with the aspnet_isapi.dll. This means that if anyone tries to access a .EXE file in this area, web.config is run and web.config contains the code: <authentication mode="Forms"> <forms name="myCookie2" loginUrl="login.aspx" />
12
7894
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 it, it works every time! I even set it to True, but did a .Flush just before the error, and the error won't happen. It only happens when response.buffer is True and no .response.flush is issued. The error is a string variable turns-up empty...
5
4560
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 a session variable, and if it is not present, does a Response.Redirect to a webpage for the CAS passing a url parameter for the url to post back to. The CAS provides a page for the user to log into, validates the username and password, and then...
4
11423
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 XMLHTTP object. However, when the page requested through the XML object makes a <%Response.Redirect()%> call, a new session is created each time. Is this a flaw in the XMLHTTP Object? How can I force the session to remain the same after a...
9
4337
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). The browser then makes a new request to the server to redirect itself to abcd.asp after which the user gets redirected to abcd.asp. But in case of Server.Execute (or Server.Transfer), when the server
0
8139
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8408
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7024
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6064
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5524
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4098
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.