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

[Solved] issue when trying to Transfer/Post to another page using grdClientSrch_ItemCommand event on a "Prometheus" grid

1 Answer 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ivo
Top achievements
Rank 1
Ivo asked on 23 Feb 2008, 06:05 PM

Hello,

I have an issue when trying to Transfer/Post to another page using grdClientSrch_ItemCommand event on a "Prometheus" grid.

 I my scenario I want to select a row from the grid and to retrieve its ID and to transfer or post to another apsx page. On the next aspx page I want to use the PreviousPage property and to cast it to my first page with the grid.

Initially I used Server.Transfer in grdClientSrch_ItemCommand event to transfer to the next page. However with this approach I received the following error:

Error:

“Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.”

 I found similar issue http://www.telerik.com/community/forums/thread/b311D-bbcbek.aspx and the conclusion was the Server.Transfer is not supported with AJAX.

 I tried to use Response.Redirect() instead and the original error has gone. However, the PreviousPage property (on the next page) is null when I use Response.Redirect(). 
In order to get this property (PreviousPage) I need to post (or transfer to)  the page and I am not sure how to do this with GridButtonColumn. For regular button I need to use PostBackUrl property and to specify the url of the next page, but I couldn’t see such a property in the command event. There might be a cast from GridButtonColumn to regular button, but I am not sure how to do this either.

I would like first to check if there is a way to use directly Transfer (for better performance) and to change the grid select event as a regular post back and bypassing the AJAX limitation above.

If the first option is not possible, I would like to check how I can post the page to another page in the most efficient way.

Thanks,
Ivo

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Feb 2008, 07:51 AM
Hi Ivo,

You can find this button and set desired settings using ItemCreated event. Here is an example:

if(e.Item is GridDataItem)
{
    LinkButton LinkButton1 = (LinkButton)((GridDataItem)e.Item)["MyColumnUniqueName"].Controls[0];
}

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Ivo
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or