Wednesday, March 21, 2012

UpdatePanel and Server.transfer

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


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.

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.

\=)


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.
i also had encoutner this problem.
does anyone have any solution for this problem?

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


You may as well try Response.Redirect.

Hi,

Response.Redirect have the same (logical) problem.


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 athttp://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.

No comments:

Post a Comment