get datagrid row number after click on hyperlink

  • Thread starter sophistLady via .NET 247
  • Start date
S

sophistLady via .NET 247

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.
 
Q

quaester

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.
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top