select button in datagrid to cause a redirect

T

TJS

I have a select button in a datagrid which I want to cause a redirect when
clicked

I have this in script
===============================
Sub Page_Load(Sender As Object, E As EventArgs)
If Not Page.IsPostBack Then
' Databind the data grid on the first request only
BindGrid()
End If
End Sub

Sub DataGrid_ItemCommand(Sender As Object, E As
DataGridCommandEventArgs)
' display a new report
If e.commandName="Select" then
response.redirect("reports.aspx?ID=" & e.item.itemindex)
End if
End Sub
================================

<asp:ButtonColumn Text="Select" ButtonType="PushButton" HeaderText="Get
Report" CommandName="Select"></asp:ButtonColumn>

but redirect does not get activated on button push
what's missing ?????????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top