D
Dawie Lombaard
Please help anyone.
I have 2 aspx pages that need to "chat" to each other. The first page
is one where 2 or more dates needs to be selected from a date picker,
which is a custom form with a datepicker on that has been customised to
display public holidays. When a date is selected / the datepicker's
selected date changes I register a script block that passes the
selected date to the "window.opener.<controlname>.value".
Code:
strScript = "<script language=""javascript"">" & _
"window.opener.document.form1." &
Trim(Request.QueryString("ControlName").ToString.Trim) & ".value = '" &
Trim(Calendar1.SelectedDate.ToString("dd MMM yyyy")) & "';" & vbCrLf &
_
"window.close();" & vbCrLf & _
"</script>"
If Not IsClientScriptBlockRegistered("sendData") Then
RegisterClientScriptBlock("sendData", strScript)
End If
This works perfectly, until the next date gets selected, then the first
date gets cleared out of the textbox which was put into.
Is there any way to prevent this from happening? I assume that once the
page does a postback it resets the controls to default values?
This problem only started occuring once the project was converted from
Visual Studio 2003 to Visual Studio 2005.
Any help or suggestions will be appreciated.
TIA.
Dawie Lombaard.
I have 2 aspx pages that need to "chat" to each other. The first page
is one where 2 or more dates needs to be selected from a date picker,
which is a custom form with a datepicker on that has been customised to
display public holidays. When a date is selected / the datepicker's
selected date changes I register a script block that passes the
selected date to the "window.opener.<controlname>.value".
Code:
strScript = "<script language=""javascript"">" & _
"window.opener.document.form1." &
Trim(Request.QueryString("ControlName").ToString.Trim) & ".value = '" &
Trim(Calendar1.SelectedDate.ToString("dd MMM yyyy")) & "';" & vbCrLf &
_
"window.close();" & vbCrLf & _
"</script>"
If Not IsClientScriptBlockRegistered("sendData") Then
RegisterClientScriptBlock("sendData", strScript)
End If
This works perfectly, until the next date gets selected, then the first
date gets cleared out of the textbox which was put into.
Is there any way to prevent this from happening? I assume that once the
page does a postback it resets the controls to default values?
This problem only started occuring once the project was converted from
Visual Studio 2003 to Visual Studio 2005.
Any help or suggestions will be appreciated.
TIA.
Dawie Lombaard.