DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Get The Value Of Hyperlink Filed In Asp.net

01.30.2012
| 4601 views |
  • submit to reddit
        // get the value of hyperlink filed in asp.net

<asp:HyperLinkField DataTextField="MyHyperlink" HeaderText="Test Link" HeaderStyle-Width="110px"
 DataNavigateUrlFields="TestId" DataNavigateUrlFormatString="~/Test.aspx?TestId={0}" />

HyperLink hypTestLink = (HyperLink)Gv.Rows[gvRow.RowIndex].Cells[testLinkcolumnindex].Controls[0];
ViewStateLinkData = string.IsNullOrWhiteSpace(hypTestLink .Text) ? 0 : Convert.ToInt32(hypTestLink .Text);