datagrid hyperlink help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • POKEMON

    #1

    datagrid hyperlink help

    hi friends,
    I have a couple of questions.

    I have a datagrid and ahyperlink coulmn on it. all I want is when I click
    the hyperlink, go to another page with the value which is in the second cell
    of the row.
    I tried this but it didnt work

    Private Sub HL_Click(ByVal sender As Object, ByVal e As System.EventArg s)
    Handles DataGrid1.Unloa d
    Session("info") =
    DataGrid1.Items (DataGrid1.Sele ctedItem.ItemIn dex).Cells(1).T ext
    End Sub


    it gives me the error:
    System.NullRefe renceException: Object reference not set to an instance of an
    object.

    I assumed that I'm populating the grid after a postback and so the
    selecteditem will be null. so I tried this:

    If DataGrid1.Items (DataGrid1.Sele ctedItem.ItemIn dex).Cells(1) Is
    DBNull.Value Then
    Session("info") = 0
    Else
    Session("info") =
    DataGrid1.Items (DataGrid1.Sele ctedItem.ItemIn dex).Cells(1).T ext

    End If


    but it didnt work too..
    how can I pass teh nullref error, is there a function like isnull in SQL?
    am I all wrong?
    AND How can I do what I want?

    please help.....
Working...