By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,617 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,617 IT Pros & Developers. It's quick & easy.

popup date picker

P: n/a
ive read a few tutorials but im still not getting anywhere (most code ive
seen is code inline - im using codebehind VB and aspx)

im creating a link button that opens a popup calendar that once a date is
picked it posts back and populates the form
i think i know where the error lies im just unsure how to fix it
my code is like this :-

the form is called form1 and the page is called test.aspx
{
Dim clientscript As String

clientscript = "<script
language='javascript'>datepick_window=window.open( 'datepicker.aspx?formname=
Form1.caltest','datepick_window','width=300,height =300');datepick_window.foc
us();</script>"
RegisterStartupScript("openwindows", clientscript)
}

This succesfully opens a popup window called datepicker.aspx with the
following code :-

Dim strjscript As String = "<script language=""javascript"">"
strjscript = "window.opener." & _
HttpContext.Current.Request.QueryString("form1") & ".caltest = '" &
_Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</script" & ">"
RegisterStartupScript("openwindows", strjscript)

ive outputted the strjscript string to a label and the output is :-

window.opener..caltest = '27/03/2004';window.close();

im guessing its to do with the
HttpContext.Current.Request.QueryString("form1") part - but now im totally
stuck!

cheers

mark
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Do you HAVE to develop the control yourself ?
I'm using the Web DatePicker from this page,
http://www.codeproject.com/vb/net/dw...kerArticle.asp

HTH

Jurjen de Groot
Netherlands.

"luna" <lu**@themoon.com> wrote in message
news:wQJ0c.2380$zu.1933@newsfe1-win...
ive read a few tutorials but im still not getting anywhere (most code ive
seen is code inline - im using codebehind VB and aspx)

im creating a link button that opens a popup calendar that once a date is
picked it posts back and populates the form
i think i know where the error lies im just unsure how to fix it
my code is like this :-

the form is called form1 and the page is called test.aspx
{
Dim clientscript As String

clientscript = "<script
language='javascript'>datepick_window=window.open( 'datepicker.aspx?formname= Form1.caltest','datepick_window','width=300,height =300');datepick_window.foc us();</script>"
RegisterStartupScript("openwindows", clientscript)
}

This succesfully opens a popup window called datepicker.aspx with the
following code :-

Dim strjscript As String = "<script language=""javascript"">"
strjscript = "window.opener." & _
HttpContext.Current.Request.QueryString("form1") & ".caltest = '" &
_Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</script" & ">"
RegisterStartupScript("openwindows", strjscript)

ive outputted the strjscript string to a label and the output is :-

window.opener..caltest = '27/03/2004';window.close();

im guessing its to do with the
HttpContext.Current.Request.QueryString("form1") part - but now im totally
stuck!

cheers

mark

Nov 18 '05 #2

P: n/a
Unless you are trying to learn something, be aware that there are many very
good datetextboxes with popup calendars. Some replace Microsoft's
server-side calendar with client side updating of dates. Mine is "Peter's
Date Package" at http://www.peterblum.com/datecontrols/home.aspx. Others are
listed at www.123aspx.com and www.411asp.net.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"luna" <lu**@themoon.com> wrote in message
news:wQJ0c.2380$zu.1933@newsfe1-win...
ive read a few tutorials but im still not getting anywhere (most code ive
seen is code inline - im using codebehind VB and aspx)

im creating a link button that opens a popup calendar that once a date is
picked it posts back and populates the form
i think i know where the error lies im just unsure how to fix it
my code is like this :-

the form is called form1 and the page is called test.aspx
{
Dim clientscript As String

clientscript = "<script
language='javascript'>datepick_window=window.open( 'datepicker.aspx?formname= Form1.caltest','datepick_window','width=300,height =300');datepick_window.foc us();</script>"
RegisterStartupScript("openwindows", clientscript)
}

This succesfully opens a popup window called datepicker.aspx with the
following code :-

Dim strjscript As String = "<script language=""javascript"">"
strjscript = "window.opener." & _
HttpContext.Current.Request.QueryString("form1") & ".caltest = '" &
_Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</script" & ">"
RegisterStartupScript("openwindows", strjscript)

ive outputted the strjscript string to a label and the output is :-

window.opener..caltest = '27/03/2004';window.close();

im guessing its to do with the
HttpContext.Current.Request.QueryString("form1") part - but now im totally
stuck!

cheers

mark

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.