Getting ID from Datagrid hyperlink column

C

Child

I have a datagrid containing a column:

<asp:Hyperlinkcolumn
headertext="View/Edit"
Datanavigateurlfield="individualid"
Datanavigateurlformatstring="edit_ind.aspx?indid={0}"
Text="View"/>


I would like to use that indid on the page the link refers to in a query. How do I retrieve it?
What scope is it in?

Thanks in advance!!

--
BethF, Anchorage, AK

It's YOUR God.
They are YOUR rules.
YOU burn in hell.
 
C

Child

Hope this helps
Private sub DataGrid_ItemCommand(ByVal source As Object,
ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs)
Handles ...

dim Mystr as string
Mystr = CType(e.Item.Cells(1).Controls(0), LinkButton).Text
'Assuming your control is in cell(1)
'Once you have the string you can extract the ID from
there.
end sub



It sure does!


--
BethF, Anchorage, AK

It's YOUR God.
They are YOUR rules.
YOU burn in hell.
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top