UpdatePanel and Server.transfer

Last post 06-01-2009 9:23 AM by alexnirvan. 10 replies.

Sort Posts:

  • Crying [:'(] UpdatePanel and Server.transfer

    03-29-2006, 12:07 AM
    • Member
      5 point Member
    • Biped
    • Member since 03-29-2006, 4:50 AM
    • Posts 1
    I have a gridview inside a updatepanel that, based on the click of a button (commandbutton) postback to server and process the some code (associated  with the command event)  the page fails to do a Server.transfer("xx.aspx")  The code is executed but the page "postback" to the old page not the
    "transfer to page". Can't you do an Server.Transfer from a control inside a AtlasPanel ??


  • Re: UpdatePanel and Server.transfer

    03-29-2006, 4:11 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs
    hello.

    well, i think you won't be able to do that. if you use fiddler, you'll notice that you're getting a pageError element (which doesn't really gives any util info).

    though i'm not sure about it, i'd say that you're getting an error from the application itself since the pageerror event of the control isn't being fired.
    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: UpdatePanel and Server.transfer

    04-03-2006, 1:54 PM

    I'm a little bit puzzled as well. It seems that through this update panel, which is doing a partial rendering of a page, you can't end execution of the main page because of the page's lifecycle. Honestly, that is just a guess. I would be curious to hear from Mike or someone on this.

    \=)

    The smile isn't just famous, its IN-FAMOUS...better than famous, IN-FAMOUS. ~ The Three Amigos
  • Re: UpdatePanel and Server.transfer

    04-03-2006, 7:56 PM
    • Contributor
      2,729 point Contributor
    • NikhilKo
    • Member since 06-10-2002, 9:32 PM
    • Redmond, WA
    • Posts 93
    • AspNetTeam
    Server.Transfer does not make sense when you use updatepanels - the client is expecting fragments of rendering to update an update panel, and not an entire new html document. For buttons that result in Server.Transfer, make sure they aren't set up as triggers for update panels.
    Nikhil Kothari

    Weblog: http://www.nikhilk.net
  • Re: UpdatePanel and Server.transfer

    06-07-2006, 5:32 AM
    • Member
      65 point Member
    • lyky
    • Member since 06-02-2006, 4:55 AM
    • Posts 13
    i also had encoutner this problem.
    does anyone have any solution for this problem?

  • Re: UpdatePanel and Server.transfer

    06-07-2006, 9:22 AM
    • Member
      55 point Member
    • nicksh
    • Member since 03-14-2006, 12:40 PM
    • Posts 11

    Hi,

    As Nikhil pointed out, doing a Server.Transfer doesn't really make sense in an AJAX callback situation. 

    Also, it seems according to microsoft unless you're writing an ApplicationController Server.Transfer is probably not a good concept to use at all as it doesn't sit very well with search engines.  I guess the only other time one would perhaps use it is if you want to display completely different pages based on certain criteria (like depending on if the user has logged in), but I would think this determination is probably best done in a HttpHandler.  I myself usually dynamically load user controls for that though.

    Nick

  • Re: UpdatePanel and Server.transfer

    06-08-2006, 2:17 AM
    • Member
      5 point Member
    • rigao
    • Member since 06-08-2006, 6:16 AM
    • Posts 1
    You may as well try Response.Redirect.
  • Re: UpdatePanel and Server.transfer

    01-05-2007, 5:23 PM
    • Contributor
      2,827 point Contributor
    • Pluginbaby
    • Member since 11-20-2005, 8:07 PM
    • Canada
    • Posts 484
    • TrustedFriends-MVPs

    Hi,

    Response.Redirect have the same (logical) problem.

    (If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

    Laurent Duveau
    Silverlight MVP / Silverlight Insider
    http://weblogs.asp.net/lduveau/
  • Re: UpdatePanel and Server.transfer

    09-12-2007, 3:40 AM
    • Member
      6 point Member
    • sprudel
    • Member since 06-07-2007, 7:51 AM
    • Posts 12

    Hi!

    I know that this thread is a bit old, but I had a similar problem with Server.Transfer and UpdatePanels.

    I found a working solution at http://brunokenj.net/blog/index.php/2007/04/09/utilizando-servertransfer-e-aspnet-ajax-10/

    Look at the first comment of the blog entry to get the code I am using.

    It would be nice If I got some opinions about this solution.

  • Re: UpdatePanel and Server.transfer

    07-30-2008, 7:17 AM

    I haven't really tried this myself, but a wild guess at a solution might be to set the UpdatePanel's UpdateMode to "Conditional" and its ChildrenAsTriggers to "false", and then call the UpdatePanel's .Update()-method manually for every control you need to trigger a refresh of the UpdatePanel. That would mean you could place a control inside the UpdatePanel, that doesn't automatically become a trigger. That control could then execute the Server.Transfer. Would that work?
  • Re: UpdatePanel and Server.transfer

    06-01-2009, 9:23 AM
    • Member
      7 point Member
    • alexnirvan
    • Member since 06-01-2009, 9:18 AM
    • Posts 7

     I've came up with solution in my project using JavaScript. Here is example:

     

                    Dim TransferPage As String
                    TransferPage = "<script>window.open('PageToGo.aspx','_self');</script>"
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "temp", TransferPage, False)

     

     

    Sic transit gloria mundi.
    Filed under:
Page 1 of 1 (11 items)