ok so i have a page with a gridview on it and it displays rows from sql table. i have also a link assigned to each row:
this works fine and the url that gets displayed is good. But i would like to send the our_ref attribute to the page itself aswell as the url and use it make further queries.
Thanks
G
fergusPosted Apr 16, 2024, 7:55 AM
@Jayraj Chhaya when i run your snippet of code
the button click does not lik to next page
Jayraj ChhayaPosted Apr 16, 2024, 6:58 AM
To achieve this functionality, you can utilize the
RowCommandevent of the GridView. When the hyperlink is clicked, theRowCommandevent is triggered, allowing you to access the row data and redirect to the target page with the necessary parameter.In your GridView markup, modify the HyperLink control to trigger the
RowCommandevent:By using the
RowCommandevent and passing the row index as theCommandArgument, you can retrieve the necessary data from the GridView row and redirect to the target page with the parameter included in the URL.Tahir AnsariPosted Apr 15, 2024, 7:02 PM
To pass the our_ref attribute to the destination page, you can use either the query string or session variables. Here's how you can do it using a query string:
Then, on the destination page (MD_Overall.aspx), you can retrieve the our_ref value from the query string: