Get Calendar control date with page pass value

Source: Internet
Author: User
calendar| Control | Page 1. Conception: WebForm1 Constructs a textbox, a hyperlink control. WEBFORM3 (Why is 3 not 2?) The following is a description of building a calendar control. When you click on the WebForm1 hyperlink, open WebForm3. After you select a date in the WebForm3 Calendar control, close the WEBFORM3, and the textbox in WebForm1 gets the date that you just selected.

2. Implementation:
1 There are ready-made date selection controls on the Web, but considering the security of the software and copyright issues, or choose their own development.

2 after obtaining the date in the WEBFORM3, the value is recorded into the session, and the WebForm1 is refreshed by means of the Javascript:window.opener.location.reload (); Window.close method. This method can be easily used when only a TextBox is built in WebForm1, but if multiple textbox is built, it is not advisable to empty other textbox contents when refreshing.

3 Use ShowModalDialog method to transfer the value, the specific method is as follows.

3. Specific procedure: (partial code)
WebForm1.aspx
<form id= "Form1" method= "POST" runat= "Server" >
<asp:textbox id= "TextBox1" runat= "Server" ></textbox>
<asp:hyperlink id= "HyperLink1" runat= "Server" navigateurl= "javascript:void (0)" >window.parent.close () </ Script ")
End Sub

4. PostScript
By using this method, you can also pass other values between windows.
Special thanks to Meng Xianhua for the relevant articles.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.