get datagrid row number after click on hyperlink

Discussion in 'ASP .Net Web Controls' started by sophistLady via .NET 247, Mar 8, 2005.

  1. Hi, I have a hyperlink column and a template column. The template column is where I display the row numbers of the datagrid.
    <asp:TemplateColumn Visible="False" HeaderText="Row Number">
    <ItemTemplate>
    <asp:HyperLink runat=server ID="lblRowNumber" Text='<%# Container.ItemIndex+1 %>' />
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:HyperLinkColumn DataNavigateUrlField="taskID" DataNavigateUrlFormatString="TaskDescription.aspx?taskID={0}" DataTextField="taskName" HeaderText="Task Name">
    </asp:HyperLinkColumn>

    When I click on the hyperlink, it will redirect me to another page. What I want is, when it goes to another page, the row number is captured and displayed on a label.
    Please help me. Thank you.
    --------------------------------
    From: sophistLady sophistLady

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>KUkR3NlUCEStA2a4t8747g==</Id>
    sophistLady via .NET 247, Mar 8, 2005
    #1
    1. Advertising

  2. sophistLady via .NET 247

    quaester Guest

    How about passing the rownumber in the hyperlink? (using late binding at the
    source view)
    then in the destination page, use the evaluate the querystring to get your
    row number.

    "sophistLady via .NET 247" wrote:

    > Hi, I have a hyperlink column and a template column. The template column is where I display the row numbers of the datagrid.
    > <asp:TemplateColumn Visible="False" HeaderText="Row Number">
    > <ItemTemplate>
    > <asp:HyperLink runat=server ID="lblRowNumber" Text='<%# Container.ItemIndex+1 %>' />
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > <asp:HyperLinkColumn DataNavigateUrlField="taskID" DataNavigateUrlFormatString="TaskDescription.aspx?taskID={0}" DataTextField="taskName" HeaderText="Task Name">
    > </asp:HyperLinkColumn>
    >
    > When I click on the hyperlink, it will redirect me to another page. What I want is, when it goes to another page, the row number is captured and displayed on a label.
    > Please help me. Thank you.
    > --------------------------------
    > From: sophistLady sophistLady
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>KUkR3NlUCEStA2a4t8747g==</Id>
    >
    quaester, Mar 9, 2005
    #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. Luis Esteban Valencia

    Make a DataGrid row editable after user selects the row

    Luis Esteban Valencia, Jan 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    351
    Luis Esteban Valencia
    Jan 12, 2005
  2. Replies:
    2
    Views:
    1,311
  3. D
    Replies:
    0
    Views:
    195
  4. AlainCD
    Replies:
    0
    Views:
    195
    AlainCD
    Jan 12, 2006
  5. Replies:
    1
    Views:
    125
Loading...

Share This Page