This is a migrated thread and some comments may be shown as answers.

Radgrid has incorrect path on second callback

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gillian
Top achievements
Rank 1
Gillian asked on 11 Aug 2008, 03:38 PM
I have a page that calls a Server.Transfer to a different page in a subfolder of the original page. 
ie page1 url = root/page1.aspx; page2 url = root/page2/page2.aspx

Page 2 contains a RadGrid within a RadAjaxPanel

If I sort by one of the columns in my grid, it works fine.  If I sort again I get a System.Web.HttpException, stating that the file '/root/page2.aspx' does not exist.

It appears as if the callback is looking for the page2 to have the same path as page 1.

There are reasons behind our paging hierarchy, and I do not want to have to move pages about.  Is there any other way to resolve this? 

Thank you

Gillian

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 14 Aug 2008, 11:31 AM
Hi Gillian,

If you are executing particial update you cannot use Server.Transfer. The reason is - partial request is always started by the client PageRequestManager object. This object expects to receive a text response from the server which must follow a specific format so that it can parse it and change the page DOM according to the changes that have been made on the server side.

If you're calling Server.Transfer, you’re executing the new page and stopping the execution of the current page. This means that the server side won't be able to "intercept" the response and change it so that it is sent back on the specific text format that the PageRequestManager object understands.

There is actually one workaround for this by placing the following code after update panel (RadAjaxPanel or UpdatePanel)

        <script type="text/javascript">  
            function EndRequestHandler()  
            {  
                theForm.action = "Page2/Page2.aspx";  
                theForm._initialAction = theForm.action;  
            }  
            if( typeof(Sys) != "undefined" )  
            {  
                EndRequestHandler();  
                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);  
           }  
        </script>        

But this is not recommended approach. You should use Response.Redirect instead.


Regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Gillian
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or