473,288 Members | 1,705 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,288 software developers and data experts.

Redirect issue

I have this code behind a button that does not work:

Dim sQuote As String = txtQuoteNum.Text

Dim iQuote As Int32 = CType(sQuote, Int32)

Dim sUrl As String = "Demographics.aspx?Quote=" & iQuote.ToString

Response.Redirect(sUrl)
I have just deployed this asp.net app to the server and have wierd
response.redirect behavior. Some pages redirect without any issue but this
button does not work. It just blanks out the current page and keeps the
current URL. If I change it to a response.write with the sUrl string and
then past it into the url it works just fine. I'm running framework 1.1

Thanks in advance,
DougS
Nov 19 '05 #1
5 4280
Try this:

Response.Clear()
Response.Redirect("Demographics.aspx?Quote=" & txtQuoteNum.Text)
Response.End()
"DougS" <do**@nospam.com> wrote in message
news:OG**************@TK2MSFTNGP15.phx.gbl...
I have this code behind a button that does not work:

Dim sQuote As String = txtQuoteNum.Text

Dim iQuote As Int32 = CType(sQuote, Int32)

Dim sUrl As String = "Demographics.aspx?Quote=" & iQuote.ToString

Response.Redirect(sUrl)
I have just deployed this asp.net app to the server and have wierd
response.redirect behavior. Some pages redirect without any issue but this
button does not work. It just blanks out the current page and keeps the
current URL. If I change it to a response.write with the sUrl string and
then past it into the url it works just fine. I'm running framework 1.1

Thanks in advance,
DougS

Nov 19 '05 #2
if what Chris suggested doesnt work, it could be because of some
exception being raised

I would do a try - catch block around those 4 lines to see if any
exception other than ThreadAbort is being raised

Chris Botha wrote:
Try this:

Response.Clear()
Response.Redirect("Demographics.aspx?Quote=" & txtQuoteNum.Text)
Response.End()
"DougS" <do**@nospam.com> wrote in message
news:OG**************@TK2MSFTNGP15.phx.gbl...
I have this code behind a button that does not work:

Dim sQuote As String = txtQuoteNum.Text

Dim iQuote As Int32 = CType(sQuote, Int32)

Dim sUrl As String = "Demographics.aspx?Quote=" & iQuote.ToString

Response.Redirect(sUrl)
I have just deployed this asp.net app to the server and have wierd
response.redirect behavior. Some pages redirect without any issue but this
button does not work. It just blanks out the current page and keeps the
current URL. If I change it to a response.write with the sUrl string and
then past it into the url it works just fine. I'm running framework 1.1

Thanks in advance,
DougS


Nov 19 '05 #3
Pass it a fully qualified URL for the redirect and see if that makes a
difference.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"DougS" <do**@nospam.com> wrote in message
news:OG**************@TK2MSFTNGP15.phx.gbl...
I have this code behind a button that does not work:

Dim sQuote As String = txtQuoteNum.Text

Dim iQuote As Int32 = CType(sQuote, Int32)

Dim sUrl As String = "Demographics.aspx?Quote=" & iQuote.ToString

Response.Redirect(sUrl)
I have just deployed this asp.net app to the server and have wierd
response.redirect behavior. Some pages redirect without any issue but this
button does not work. It just blanks out the current page and keeps the
current URL. If I change it to a response.write with the sUrl string and
then past it into the url it works just fine. I'm running framework 1.1

Thanks in advance,
DougS

Nov 19 '05 #4
Those are good ideas. I tried this:
Try
Response.Clear()
Response.Redirect("Demographics.aspx?Quote=" & txtQuoteNum.Text)
Response.End()
Catch ex As Exception
Me.lblError.Text = ex.Message
End Try
I still get the same behavior.

I then tried this:
Try
Response.Clear()
Response.Write("http://mydomain/appfolder/Demographics.aspx?Quote="
& txtQuoteNum.Text)
Response.End()
Catch ex As Exception
Me.lblError.Text = ex.Message
End Try

I took the string that resulted from the response.write and pasted it in the
address bar and it worked correctly. Is there some setting I'm missing in
IIS or in my page directives. This is my first ASP.Net app (obviously) and
it's driving me crazy.

Thanks,
DougS
<sr**********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
if what Chris suggested doesnt work, it could be because of some
exception being raised

I would do a try - catch block around those 4 lines to see if any
exception other than ThreadAbort is being raised

Chris Botha wrote:
Try this:

Response.Clear()
Response.Redirect("Demographics.aspx?Quote=" & txtQuoteNum.Text)
Response.End()
"DougS" <do**@nospam.com> wrote in message
news:OG**************@TK2MSFTNGP15.phx.gbl...
>I have this code behind a button that does not work:
>
> Dim sQuote As String = txtQuoteNum.Text
>
> Dim iQuote As Int32 = CType(sQuote, Int32)
>
> Dim sUrl As String = "Demographics.aspx?Quote=" & iQuote.ToString
>
> Response.Redirect(sUrl)
>
>
> I have just deployed this asp.net app to the server and have wierd
> response.redirect behavior. Some pages redirect without any issue but
> this
> button does not work. It just blanks out the current page and keeps the
> current URL. If I change it to a response.write with the sUrl string
> and
> then past it into the url it works just fine. I'm running framework 1.1
>
> Thanks in advance,
> DougS
>

Nov 19 '05 #5
I never could figure out why it didnt work. Crazy to spend this much time on
one line of code that should work. I ended up using server.transfer

Thanks,
DougS

"DougS" <do**@nospam.com> wrote in message
news:eF**************@TK2MSFTNGP10.phx.gbl...
Those are good ideas. I tried this:
Try
Response.Clear()
Response.Redirect("Demographics.aspx?Quote=" &
txtQuoteNum.Text)
Response.End()
Catch ex As Exception
Me.lblError.Text = ex.Message
End Try
I still get the same behavior.

I then tried this:
Try
Response.Clear()

Response.Write("http://mydomain/appfolder/Demographics.aspx?Quote=" &
txtQuoteNum.Text)
Response.End()
Catch ex As Exception
Me.lblError.Text = ex.Message
End Try

I took the string that resulted from the response.write and pasted it in
the address bar and it worked correctly. Is there some setting I'm missing
in IIS or in my page directives. This is my first ASP.Net app (obviously)
and it's driving me crazy.

Thanks,
DougS
<sr**********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
if what Chris suggested doesnt work, it could be because of some
exception being raised

I would do a try - catch block around those 4 lines to see if any
exception other than ThreadAbort is being raised

Chris Botha wrote:
Try this:

Response.Clear()
Response.Redirect("Demographics.aspx?Quote=" & txtQuoteNum.Text)
Response.End()
"DougS" <do**@nospam.com> wrote in message
news:OG**************@TK2MSFTNGP15.phx.gbl...
>I have this code behind a button that does not work:
>
> Dim sQuote As String = txtQuoteNum.Text
>
> Dim iQuote As Int32 = CType(sQuote, Int32)
>
> Dim sUrl As String = "Demographics.aspx?Quote=" & iQuote.ToString
>
> Response.Redirect(sUrl)
>
>
> I have just deployed this asp.net app to the server and have wierd
> response.redirect behavior. Some pages redirect without any issue but
> this
> button does not work. It just blanks out the current page and keeps
> the
> current URL. If I change it to a response.write with the sUrl string
> and
> then past it into the url it works just fine. I'm running framework
> 1.1
>
> Thanks in advance,
> DougS
>


Nov 19 '05 #6

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

Similar topics

7
by: ndessai | last post by:
Hi All, I discovered following issue with the VC 7.1 compiler regarding the backword compatibility. I created a dll (Redirect.dll) which exposes a function and simply writes some text (say...
6
by: Peter Row | last post by:
Hi, I am writing a DLL in VB.NET that implements IHttpHandler.ProcessRequest. This code calls a sub and I need to know if that sub did a response redirect or not. Specifically I need to know...
2
by: Brian | last post by:
I'm trying to response.redirect to another page on a button click event and I get an error message stating that the thread was being aborted (if I trap for the error that is...) I've researched...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
1
by: Andy Todd | last post by:
Hi We have just moved an ASP.NET application into the live environment which is as follows: Sun Proxy Server / Firewall Windows 2000 Server / IIS5 The URL for the site maps to the Sun...
10
by: Johnny Fugazzi | last post by:
I have a couple of pages that have started showing an odd problem. When the code calls Response.Redirect("file.aspx"), nothing happens. The page goes white, and the old URL and querystring are...
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...
5
by: Seb | last post by:
Hi, We have a page in VB.NET redirecting to an external site. Example: http://mysite.com/redirect.aspx?url=http//externalsite.com/their-page.asp The target page on the external site...
3
by: Sarah | last post by:
I was wondering if someone might be able to help me with this issue. I have a feeling this has something to do with my host's server settings as I used to be able to get CURL to follow redirects by...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
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
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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...

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.