views:

783

answers:

4

How to use Server.Transfer or Response.Redirect from ajax UpdatePanel?

A: 

Never mind, i just found out myself
use javascript inside ur Updatepanel like the code below.

c# code:


String TransferPage = "window.open('Gallery-Page.aspx','_self');";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "temp", TransferPage, false);

Even u can give hyperlink instead of "Gallery-Page.aspx"

Thanks,
Asem Ibohal

Asem Ibohal
@Eibx's solution using window.location is better, IMO.
tvanfosson
+1  A: 

Without being harsh, it really doesn't make sense to be able to. I think some reading about AJAX would make it clear.

But you could write following to the browser.

<script type="text/javascript">window.location = "URL"</script>
Eibx
A: 

UpdatePanel supports Response.Redirect. It works OK for me. What error do you get?

thorn
A: 

Here is blog post that will help you to resolve the issue.

http://patelshailesh.com/index.php/response-redirect-throws-an-error-when-called-inside-update-panel

shailesh