Question : Popup Calendar problem in C#

Popup calendar does not close/return selected date to calling page.

I am using following code to call popup calendar control,


In frmCalendar.aspx,

 protected void Page_Load(object sender, EventArgs e)
    {
        myHidden.Value = Request.QueryString["textbox"].ToString();              //myHidden is hidden control  
    }

protected void Calendar1_SelectionChanged(object sender, System.EventArgs e)
    {
        string strScript = "";
        ClientScript.RegisterClientScriptBlock(this.GetType(), "anything", strScript);


Where I have error in the code. Program does not show any error but it does not close popup window.
I am using MasterPage in calling from.

Thanks

Answer : Popup Calendar problem in C#

Declare 2 public variables in your class, change your script to below and register this in the Page_Load:

public string strControlName;
public string strSelectedDate;

protected void Page_Load(object sender, EventArgs e)
{
    strControlName = Request.QueryString["textbox"];
    strSelectedDate = Calendar1.SelectedDate.ToString("MM/dd/yyyy");

    string strScript = "
Random Solutions  
 
programming4us programming4us