Code works in VS2003 but not in VS2005
Posted on 2006-05-09
I have an aspx page in Visual Studio 2003 with a datagrid on it. I have the next code for highlighting the grid row when the mouse is over and then when the user clicks on the row it takes a copule of parameters (IdArea, AreaName) and redirects the browser to another aspx page.
This code works very well in VS2003 but I recently migrated this project to VS2005 and it does not work anymore, I tried to make it work but it seems I can't do it. What is happening (I suppose) is that the DataGrid1_SelectedIndexChanged event is not firing when the user clicks on the datagrid row so I have a page postback but no redirection at all.
Does anyone has any idea why this code stopped working ??
I would appreciate any help in this matter.
Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged
DataGrid1.SelectedItem.Attributes.Item("onmouseover") = "this.style.cursor='hand'"
'--Redirect to WebForm2
Dim url As String
url = "WebForm2.aspx?IdArea=" + DataGrid1.SelectedItem.Cells(0).Text + "&AreaName=" + DataGrid1.SelectedItem.Cells(1).Text
Private Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemCreated
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.SelectedItem Then