How about using a asp:button or and asp:HyperLink that posts back to the page with the gridview. You could then use the RowCommand event of the grid
view to save the data you need in the "ErrorLookUp.aspx" page in the session object and use either server.transfer() or response.redirect() to send the user to "ErrorLookUp.aspx". There you could check in the Form_Load event whether the Values in the Session
object have been set and based on that run the code.
This way you don't need to expose BatchID and StatusID. Do you want this behaviour for security reasons?
I have been thinking that maybe i can use LinkButton with PostBackUrl="ErrorlookUp.aspx" and on Page_Load event of ErroLookUp i can check with PreviousPage to get Form variables.
My only concern is that i will probably need to create hidden fields and everytime i click on the link i will need to populate the hidden field with Batch And Status Id.
In addition, my GridView is in UpdatePanel, therefore i cant use Server.Transfre method. If i try using, i am getting back different errors due to fact LinkButton is AsyncPostback.
If you have no other buttons in the grid view that you want to cause an async-postback in the update panel, you could set the following properties in the update panel:
UpdateMode=Conditional
ChildrenAsTriggers=False
Now you just have to add all the other controls by hand that should raise an async-postback via the update panel. You can add them by editing the triggers collection.
Unfortunately, i have Paging and Sorting which i would like to AsyncPostBack them.However, i tried to programatically create new PostBack triggers for my update panel. But i got stuck there too.
Kiril2006
Member
305 Points
130 Posts
cross page PostBack
Aug 07, 2007 10:13 PM|LINK
Helloo,
I have gridView with links. Each link is dynamically populated with different IDs on DataRowBound event.
This is what one of the links in my GridView looks like:
<a href=""ErrorLookUp.aspx?batchID=1&StatusID=1"">{1}</a>
This way though, I am exposing the BatchID and StatusID.
So i just want to find out what is the best way toPostBack to ErrorLookUp.aspx with exposing any QuerryStrings?
kaktus
Member
36 Points
10 Posts
Re: cross page PostBack
Aug 08, 2007 11:38 AM|LINK
How about using a asp:button or and asp:HyperLink that posts back to the page with the gridview. You could then use the RowCommand event of the grid view to save the data you need in the "ErrorLookUp.aspx" page in the session object and use either server.transfer() or response.redirect() to send the user to "ErrorLookUp.aspx". There you could check in the Form_Load event whether the Values in the Session object have been set and based on that run the code.
This way you don't need to expose BatchID and StatusID. Do you want this behaviour for security reasons?
www.xabbu.ch
Kiril2006
Member
305 Points
130 Posts
Re: cross page PostBack
Aug 08, 2007 05:11 PM|LINK
Hi, thanks for your respond.
The main reason for this is Security.
I have been thinking that maybe i can use LinkButton with PostBackUrl="ErrorlookUp.aspx" and on Page_Load event of ErroLookUp i can check with PreviousPage to get Form variables.
My only concern is that i will probably need to create hidden fields and everytime i click on the link i will need to populate the hidden field with Batch And Status Id.
Kiril2006
Member
305 Points
130 Posts
Re: cross page PostBack
Aug 08, 2007 06:06 PM|LINK
In addition, my GridView is in UpdatePanel, therefore i cant use Server.Transfre method. If i try using, i am getting back different errors due to fact LinkButton is AsyncPostback.
Any other suggestions?
kaktus
Member
36 Points
10 Posts
Re: cross page PostBack
Aug 09, 2007 11:11 AM|LINK
If you have no other buttons in the grid view that you want to cause an async-postback in the update panel, you could set the following properties in the update panel:
UpdateMode=Conditional
ChildrenAsTriggers=False
Now you just have to add all the other controls by hand that should raise an async-postback via the update panel. You can add them by editing the triggers collection.
Hope this helps
www.xabbu.ch
Kiril2006
Member
305 Points
130 Posts
Re: cross page PostBack
Aug 09, 2007 04:04 PM|LINK
Unfortunately, i have Paging and Sorting which i would like to AsyncPostBack them.However, i tried to programatically create new PostBack triggers for my update panel. But i got stuck there too.