Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspdotnet_website_programming thread: getting href text


Message #1 by Greg Partin <GPartin@c...> on Mon, 8 Apr 2002 17:18:52 -0400
	  
Hi folks,

I have a small problem.  I have a datagrid with a asp:hyperlinkcolumn.  I
need to get the text out of that cell.
Here is the code I am using:


        Dim i As Integer = e.Item.Cells.Count
        Dim j As Integer = 0 ' Counter variable
        Dim oCell As TableCell

        Response.Write("<P>")
        ' Write out the ItemType
        Response.Write("Item Type: " & e.Item.ItemType.ToString() &
",&nbsp")
        Response.Write("Cells: " & i.ToString() & "<BR>")

        ' Enumerate the Cells in the current Item
        For Each oCell In e.Item.Cells

            ' Display the contents of the Cells</KBD>
            Response.Write("&nbsp;&nbsp;Cell " & j & " contains " &
oCell.Text.ToString() & "<BR>")
            Response.Write("&nbsp;&nbsp;Cell " & j & " contains " &
e.Item.Cells(j).Text.ToString() & "<BR>")
            j += 1
        Next
        Response.Write("</P>")

This code works fine with the cells that are asp:boundcolumn but nothing
gets printed out for the hyperlink columns.  Any suggestions/ideas?

thanks in advance,
Greg

  Return to Index