select button in datagrid to cause a redirect

Discussion in 'ASP .Net Web Controls' started by TJS, Nov 21, 2003.

  1. TJS

    TJS Guest

    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 ?????????
    TJS, Nov 21, 2003
    #1
    1. Advertising

  2. TJS

    TJS Guest

    problem found

    "TJS" <> wrote in message
    news:e9gP%...
    > 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 ?????????
    >
    >
    >
    TJS, Nov 22, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Row
    Replies:
    0
    Views:
    418
    Peter Row
    Jan 28, 2004
  2. Replies:
    8
    Views:
    5,428
  3. Jeremy Chapman
    Replies:
    0
    Views:
    930
    Jeremy Chapman
    Nov 16, 2006
  4. Sal
    Replies:
    1
    Views:
    362
  5. palmiere
    Replies:
    1
    Views:
    317
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page