0
votes

Ok so i have searched all over the internet for a solution and i havent found one.

So ill ask here...

I have a populated gridview 3 of the columns are linkbuttons 2 of them redirect and one of them downloads a file. The gridview is inside the Update panel. When u click the link it looks like it refreshes the website... the gridview is gone nothing to see but all the other elements are there. So the question is how do i make a linkbutton that would redirect to a diffrent page and is inside a gridview, which is inside a updatepanel, work.

Tnx for the answers.

1

1 Answers

3
votes

I would first of all use a template field in the grid which contains the linkbuttons you want in the Gridview and make sure each of them has an unique ID and commandname.

I would then assign values per row in the rowdatabound event of the grid to the linkbuttons as it populates the grid.

Then when someone click on one of the linkbuttons I would use the rowcommand event, of the grid, to execute the code for the link buttons. Use a switch command to find out which commandname caused the event and execute your code there.