What's missing in the code

  • 13 years ago

    hi all,

    Following is the code I am using to get the value of a calendar control in a variable....but it is not happening, can anyone suggest me where I am going wrong:

    protected void cntCalendar_SelectionChanged(object sender, EventArgs e)

    {

    string scr = @"<script>

    function Done()

    {

    var st = document.getElementById('cntCalendar').value = (cntCalendar.SelectedDate.ToShortDateString());

    window.opener.update(st);

    window.close();

    }

    </script>"
    ;

     

     

    Page.ClientScript.RegisterClientScriptBlock(
    typeof(Page), "done", scr);

     

     Regards,

    Royal

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila” - Mitch Ratcliffe