473,403 Members | 2,354 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,403 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 4284
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
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.