Results 1 to 7 of 7

Thread: Response.redirect problem

  1. #1

    Thread Starter
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    Question 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 ???....

    thanks in advance.....
    MCP, MCTS, Microsoft MVP [Asp.Net/IIS]

    For more .NET development tips visit .NET Tips

    If the post is useful then please Rate it

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  3. #3

    Thread Starter
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    Question 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....
    MCP, MCTS, Microsoft MVP [Asp.Net/IIS]

    For more .NET development tips visit .NET Tips

    If the post is useful then please Rate it

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width