Click here to Skip to main content
Licence CPOL
First Posted 11 May 2004
Views 138,208
Bookmarked 28 times

PopUp Calendar

By | 23 Oct 2006 | Article
Popup Calendar for ASP.NET Applications
Screenshot - image002a.jpg Screenshot - image002ka.JPG

Introduction

This is Vivek's Popup Calendar using ASP.NET, Jscript and C#. The popup calendar I have developed using Microsoft technology is more simple to use and easy to integrate with your .NET web application. Software requirements to run this program:

  • .NET Framework
  • IIS Web Server
  • Internet Explorer

How to run this program:

  • First, create a virtual directory in your web server for this program with your desired name.
  • Include all the files in the folder PopUpByVivek into your virtual directory.
  • Next right click on the file TestSreen.aspx and click browse.

Important Code Parts of the Application

C# Code

private void CalVivek_SelectionChanged(object sender, System.EventArgs e)
{
    if (Request.QueryString["textbox"] != "")
    {
        string strScript = "<SCRIPT>window.opener.document.forms(0)." + 
            Request.QueryString["textbox"].ToString() + ".value = '";
        strScript += CalVivek.SelectedDate.ToString("MM/dd/yyyy");
        strScript += "';self.close()";
        strScript += "</" + "script>";
        RegisterClientScriptBlock("Calendar_ChangeDate", strScript);
    }
}

Jscript Code

var popUp; 

function OpenCalendar(idname, postBack) 
{ 
    popUp = window.open('Calendar.aspx?formname=' + 
        document.forms[0].name + 
        '&id=' + idname + '&selected=' + 
        document.forms[0].elements[idname].value + 
        '&postBack=' + postBack, 'popupcal', 
        'width=165,height=208,left=200,top=250'); 
}

function SetDate(formName, id, newDate, postBack) 
{ 
    eval('var theform = document.' + formName + ';'); 
    popUp.close(); 
    theform.elements[id].value = newDate; 
    if (postBack) __doPostBack(id,''); 
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

vivekthangaswamy

Architect

India India

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 Pinmembernabinaya1:57 2 Nov '10  
GeneralMy vote of 1 Pinmemberpuwanes22:05 15 Oct '09  
Generalcode to pick up more than 1 date PinmemberBidisha21:31 23 Apr '08  
GeneralI can't believe!! Pinmembercykophysh3913:56 19 Oct '06  
GeneralRe: I can't believe!! Pinmembervivekthangaswamy7:33 23 Oct '06  
GeneralWorst example - EVER !! PinmemberMetroplexual12:10 4 Oct '05  
GeneralRe: Worst example - EVER !! Pinmembersherwinds20:10 26 Feb '06  
GeneralCorrect the codes PinmemberAttila Balogh3:28 30 Sep '05  
AnswerRe: Correct the codes PinsussAnonymous20:04 2 Oct '05  
Generalabout calendar in asp.net Pinmembernirav9919:55 15 Feb '05  
GeneralImage on Test Page Pinmemberparidip14:07 16 Jun '04  
GeneralRe: Image on Test Page PinsussAnonymous6:55 25 Jun '04  
GeneralRe: Image on Test Page Pinmemberdricks22222:05 13 Oct '04  
GeneralRe: Image on Test Page Pinmemberredj0:36 15 Nov '04  
GeneralWOW great stuff Pinmembertim_mcgwyn9:22 13 May '04  
GeneralRe: WOW great stuff Pinmembervivekthangaswamy23:17 13 May '04  
QuestionWhere is the code? PinmemberEric Engler8:32 12 May '04  
AnswerRe: Where is the code? Pinmemberlionli21516:00 12 May '04  
GeneralRe: Where is the code? Pinmembervivekthangaswamy23:28 13 May '04  
AnswerRe: Where is the code? Pinmembervivekthangaswamy3:42 17 May '04  
GeneralRe: Where is the code? PinmemberEric Engler4:16 17 May '04  
GeneralRe: Where is the code? Pinmemberkeerthikamalapuri5:17 11 Mar '05  
GeneralLEFT......... PinsussAnonymous7:47 12 May '04  
GeneralRIGHT............... PinsussAnonymous2:09 12 May '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 23 Oct 2006
Article Copyright 2004 by vivekthangaswamy
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid