ThatRickGuy
Programmer
Hey guys, getting close to having this project wrapped up. One thing that I am not quite pleased with is the performance of my popup calendar though.
It uses Javascript to open:
And to return the value to the parent:
Which is all fine and good, except that the ASP.Net Calendar defaults to Todays date, even if the user has already entered a value and is modifying a record.
I can use JavaScript to get the value from the textbox on the parent form from the calendar:
But that gets the value on the client side, and the calendar control has to be set server side. So I need to check that value on load, if it's a valid date save it in some statefull way, then reload the page and set the calendar date.
The problem is, how can I get the value that is returned by that function into the state bag?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
I believe in killer coding ninja monkeys.![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
It uses Javascript to open:
Code:
function GetDate(CtrlName)
{
ChildWindow = window.open('Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlName, "PopUpCalendar",
"width=250,height=270,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
}
And to return the value to the parent:
Code:
function ReturnDate()
{
window.opener.document.forms["<%= strFormName %>"].elements ["<%= strCtrlName %>"].value = "<%= strSelectedDate %>" + " " + "<%= strSelectedTime %>";
window.close();
}
Which is all fine and good, except that the ASP.Net Calendar defaults to Todays date, even if the user has already entered a value and is modifying a record.
I can use JavaScript to get the value from the textbox on the parent form from the calendar:
Code:
function GetDate()
{
return (String(window.opener.document.forms["<%= strFormName %>"].elements["<%= strCtrlName %>"].value).substring(0,10));
}
But that gets the value on the client side, and the calendar control has to be set server side. So I need to check that value on load, if it's a valid date save it in some statefull way, then reload the page and set the calendar date.
The problem is, how can I get the value that is returned by that function into the state bag?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)