Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.Redirect Not working

Status
Not open for further replies.

pabby

IS-IT--Management
Jan 5, 2004
47
GB
I have an vb.net IF/THEN/ELSE statement at the end of which redirects back to the same page.

This is because users will have filled out all the fields on the page and the easiest way to empty all the fields was to do a redirect back to itself and reload the page. It works fine but when a colleage tries it in his environment, all of the pc's that we have tried it on show a blank browser area when the submit button is clicked - no fields at all!

I have tried putting in an external web address to see if the redirect is doing anything - but no - still a blank browser. Is there any setting in IIS that stops response.redirects from working? The reason I say IIS is because something is affecting all of the browsers for this application.

Any help would be appreciated.

thanks,


Paul

 
There is no reason a response.redirect should fail. Can you post your code.

I think you could get away with a Server.Transfer. It's a little faster.
 
Server.Transfer also has the benifit of allowing you to take the forms and querystring collections with you :)

I would tend to be asking the question. Is your Response.Redirect being hit?

(but my vote is change if possible to what stsuing is sugesting.)

 
>>I think you could get away with a Server.Transfer. It's a little faster.

how? server.transfer is internal, agreed, but wont it involve transferring all the data(form and querystring) from the original file to the new file?

if it is a simple redirect then i guess the best would be a response.redirect()...

Known is handfull, Unknown is worldfull
 
It's faster because Response.Redirect() does the redirection client side and involves 2 round trips to the server.

Even if Server.Transfer didn't lost the form values, the Original poster didn't say he needed any form variables, in fact he wanted the form to be cleared.

You can preserve the form data and query string data of the original page by passing a true value to the optional second argument of the server.transfer() method.
 
oh u looked at that from that angle, i looked at it at from another angle (let the browser take the redirection burden)...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top