Response.redirect problem
I have used following code on my button click
Code:
Response.Redirect("http://www.microsoft.com/gohere/look.htm");
but the problem is i have to click 2 times for nevigation.
when i clicked for fitst time it just refresh the page ...and second time it actually nevigates the page...
what should i do ???....:confused:
thanks in advance.....
Re: Response.redirect problem
Hey,
What you have should do what you want, so there must be something else on the page that is causing a problem.
Is this the only code that you have in the click event?
Can you show all the code you are using?
Gary
Re: Response.redirect problem
actually..there are two sites deployed on our IIS
so from one site we have try to open another site...
say i have site1 and site2
on site 1 we have a default.aspx code by using which we open the other site
response.redirect("http://192.1.1.1/site2/welcome.aspx?T=F")
so this will work but it needs twice click on submit button
what should do ???
is there any page setting ???
thnaks for reply....:)
Re: Response.redirect problem
Hey,
Based on what you have told me, I can't see why this wouldn't work, so I think there must be something else going on in the page. Is that really the only code that you have on the page? Can you try a simple page that only does the redirect?
Gary
Re: Response.redirect problem
Set a breakpoint in your click event. Does it get hit the first time you click the button? It obviously gets hit the second time.
Re: Response.redirect problem
Where is this button exactly? Is it in some way being touched by the page load? Do you have an IsPostBack check in the Page Load? Because it's possible that something in the page load is causing the viewstate for the page is being reset.
Re: Response.redirect problem
Hey,
This is the sort of thing that I was thinking about, hence the request to see the rest of the OP's code, but we haven't seen it yet.
Gary