Last post Aug 09, 2007 05:04 PM by Kiril2006
Aug 07, 2007 11:13 PM|Kiril2006|LINK
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:
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?
Aug 08, 2007 12:38 PM|kaktus|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?
Aug 08, 2007 06:11 PM|Kiril2006|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.
Aug 08, 2007 07:06 PM|Kiril2006|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?
Aug 09, 2007 12:11 PM|kaktus|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:
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
Aug 09, 2007 05:04 PM|Kiril2006|LINK