Protected Sub LinkButton_Click(sender As [Object], e As EventArgs)
Dim url As String = "TotalEffort.aspx?ID="&ID
Dim s As String = (Convert.ToString("window.open('") & url) + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');" ClientScript.RegisterStartupScript(Me.[GetType](), "script", s, True)
End Sub
I have above code for a pop up window to be displayed when clicked on a link button in grid view
The ID is to be taken from the first column of the respective row.And also when TotalEffort.aspx is opened I need to retrieve the ID passed in the url.
I wrote following code for retrieving the ID
If Not String. IsNullOrEmpty(Request. QueryString("ID").To String())Then
Dim ID As String
ID=Request. QueryString("ID").ToString()
Me.BindGrid(ID)
End If
And Following BindGrid method
Private Sub BindGrid(ByVal ID As String)
Dim objEffort As New Efforts
Dim dsEfforts As New DataSet
dsEfforts=ObjEffort.GetEffort(ID)
gvEfforts.DataSource=dsEfforts.Table(0)
gvEfforts.DataBind()
End Sub
Query in GetEffort(ID) is
Select Name, Effort from Effort where ID=@ID
I am getting object reference not set to an instant of object
Can someone help me out in displaying name and effort in popup window comparing the ID