Hi
I've got a datagrid that has dynamic buttons created in some of the cells. When the user clicks them, depending on the value in the cell, they'll either receive a confirmation form or an error message, both of which are forms in div tages so are just being shown & hidden accordingly. This all works fine on my dev pc in both IE6 & IE7. However....as soon as upload it to the client's server I get "Object reference not set to an instance of an object.
at XXX.uc1.btn_Click(Object sender, EventArgs e)" when the button is clicked. Also strangely when you hover over the button on the client site, there is no text in the status bar, but in dev, it shows the current page's link.
I'm developing on XP sp2 with IIS 5.1, .net 1.1.4322.573 and so is the client pc
in my datagrid itemdatabound I've got
btn = New Button
btn.Text = "Build"
btn.ID = e.Item.Cells(i).Text
btn.CssClass = "btnBuild"
AddHandler btn.Click, AddressOf btn_Click
e.Item.Cells(i).Controls.Add(btn)
Then
Protected Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Select Case CType(sender, Button).Text
Case "Cancel"
divError.Style.Item("display") = "block"
DivShim.Style.Item("display") = "block"
Case "Empty Slot"
divConfirm.Style.Item("display") = "block"
DivShim2.Style.Item("display") = "block"
End Select
Any pointers would be greatly appreciated as I can't work out why it won't work.
Cheers
Lbob
I've got a datagrid that has dynamic buttons created in some of the cells. When the user clicks them, depending on the value in the cell, they'll either receive a confirmation form or an error message, both of which are forms in div tages so are just being shown & hidden accordingly. This all works fine on my dev pc in both IE6 & IE7. However....as soon as upload it to the client's server I get "Object reference not set to an instance of an object.
at XXX.uc1.btn_Click(Object sender, EventArgs e)" when the button is clicked. Also strangely when you hover over the button on the client site, there is no text in the status bar, but in dev, it shows the current page's link.
I'm developing on XP sp2 with IIS 5.1, .net 1.1.4322.573 and so is the client pc
in my datagrid itemdatabound I've got
btn = New Button
btn.Text = "Build"
btn.ID = e.Item.Cells(i).Text
btn.CssClass = "btnBuild"
AddHandler btn.Click, AddressOf btn_Click
e.Item.Cells(i).Controls.Add(btn)
Then
Protected Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Select Case CType(sender, Button).Text
Case "Cancel"
divError.Style.Item("display") = "block"
DivShim.Style.Item("display") = "block"
Case "Empty Slot"
divConfirm.Style.Item("display") = "block"
DivShim2.Style.Item("display") = "block"
End Select
Any pointers would be greatly appreciated as I can't work out why it won't work.
Cheers
Lbob