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

Redirect "refreshes" grid

4 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric Skaggs
Top achievements
Rank 2
Eric Skaggs asked on 31 Dec 2008, 04:58 PM
Hello,

I hope you're all enjoying the holidays.  Here's a quick scenario describing my situation.  Everything uses AJAX.

I have a grid on a page that is filled with some data.  I have a GridTemplateColumn in the grid that contains some custom LinkButton controls.  Upon clicking a LinkButton, a server-side event is fired that calls the RadAjaxManager1.Redirect() method to take me to another page.  However, I've noticed that when I click the LinkButton, the grid goes into a "Loading" mode, comes out of this "Loading" mode (so that I can again see the contents of the grid), and THEN the browser redirects.  Everything is working as it should, but I have a need to either a) keep the grid in the "Loading" mode while the browser performs the redirect or b) redirect the browser right away without the grid ever entering this "Loading" mode.

Does that make sense?  I'd appreciate any help you can offer.

Thank you,

Eric Skaggs

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 05 Jan 2009, 07:44 AM
Hello Eric,

Generally in ajax mode redirects will be performed asynchronously. The ajax manager will look for "location" header  in the response and will perform redirect client-side.

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Eric Skaggs
Top achievements
Rank 2
answered on 05 Jan 2009, 03:32 PM
So is there no way to accomplish what I need?
0
Sebastian
Telerik team
answered on 08 Jan 2009, 12:02 PM
Hi Eric,

If you want to bypass the loading phase based on your description, you may consider replacing the LinkButton inside the template column with asp HyperLink (for example) or a plain anchor tag to perform the redirect operation.

You may also use another html control, intercept its onclick client event and set window.location.href from within its onclick client handler.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Eric Skaggs
Top achievements
Rank 2
answered on 19 Jan 2009, 09:05 PM
I just discovered today that using Response.Redirect() instead of RadAjaxManager1.Redirect() achieves my goal.  I'm not sure what the difference is between the two.  Now when I click a button in the grid, the grid goes into its "loading" state (as I call it, anyway), and stays in its loading state until the redirect takes place.  This is exactly what I needed.  If anyone has any follow-up info on why this is, please feel free to share it.

Thanks again for all the help,

Eric Skaggs
Tags
Grid
Asked by
Eric Skaggs
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Eric Skaggs
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or