M
MasterChief
I have a imagebutton that when you click on it, it will open up a page
containing a calender. When the pages starts up it gives the error
Object reference not set to an instance of an object.
and it highlights the line control.value =
Request.querystring("textbox").ToString()
Here is the my code
Public Class _popcal
Inherits System.Web.UI.Page
Protected WithEvents thedate As System.Web.UI.WebControls.Calendar
Protected WithEvents control As
System.Web.UI.HtmlControls.HtmlInputHidden
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
control.Value = Request.QueryString("textbox").ToString()
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Dim script(4) As String
script(1) = "<script>window.opener.document.forms[0]." +
control.Value + ".value = '"
script(2) = thedate.SelectedDate.ToString("dd/MM/yyyy")
script(3) = "';self.close()"
script(4) = "</" + "script>"
RegisterClientScriptBlock("test", Join(script, ""))
End Sub
End Class
containing a calender. When the pages starts up it gives the error
Object reference not set to an instance of an object.
and it highlights the line control.value =
Request.querystring("textbox").ToString()
Here is the my code
Public Class _popcal
Inherits System.Web.UI.Page
Protected WithEvents thedate As System.Web.UI.WebControls.Calendar
Protected WithEvents control As
System.Web.UI.HtmlControls.HtmlInputHidden
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
control.Value = Request.QueryString("textbox").ToString()
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Dim script(4) As String
script(1) = "<script>window.opener.document.forms[0]." +
control.Value + ".value = '"
script(2) = thedate.SelectedDate.ToString("dd/MM/yyyy")
script(3) = "';self.close()"
script(4) = "</" + "script>"
RegisterClientScriptBlock("test", Join(script, ""))
End Sub
End Class