First of all, let’s write the parent window’s ASPX code. All we need is the input TextBox server control and a HTML button:
The procedure above uses window.open to open the popup window with the specified size, and with no scrollbar, menu, toolbar, status bar, and makes it not resizable. The first parameter is the Url of the page to load into the new window, and from the code above you see that it loads a DatePicker.aspx page with a Ctl parameter in the querystring, whose value is that passed in input to the PopupPicker procedure.
We’re done with the main page, now we have to write the DatePicker.aspx page, that renders the calendar. Let’s see the code first:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="DatePicker.aspx.vb" _ Inherits="FrameTest.DatePickerPage"%>