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.