Results 1 to 3 of 3

Thread: Date picker popup calendar in formview

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    5

    Date picker popup calendar in formview

    Hi there, I need some help with building a date picker popup calendar standard control in my formview control. I have a formview control in insert template mode. One of the text boxes (ID: DespatchDateTextBox0) control is bound to date field in the database, that I would like users to fill in using calendar control. I have attached the code behind for insert template, highlighting the date text box I want the calendar to use as an output. I am new to asp.net, have been searching on the net for help with this. There are a number of examples using java script for pop up calendar but I am slightly unsure how do I insert this code in the code behind page built in using vb as scripting language. I am using vwd express 08. Hope this is making sense, let me know if I have left anything out.
    Thanks, gsrai31
    Attached Files Attached Files

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Date picker popup calendar in formview

    Hello, welcome to the forums (sort of).

    The Calendar control is something of a burden... it is a server-side control and because of this, using it in your form can be quite tedious - the user will need to click and wait for a postback to occur every time she clicks something.

    The reason you see so many javascript examples out there is because it's easier to use.

    Most javascript calendar controls will require you to add one .js file to your page and when you call the calendar, it's a matter of passing the ID of the textbox (DespatchDateTextBox) to the function for the calendar. The javascript calendar uses this ID when it is writing the value back after the user has selected what she needs.

    Start by choosing the calendar you want. You can do a search. Here are just a few examples

    http://codetale.com/2007/11/19/javas...r-widget-v107/
    http://dali.mty.itesm.mx/~hugo/js/datepickercontrol/
    http://www.garrett.nildram.co.uk/calendar/scw.htm

    They also come with instructions. Post back and ask if you are having difficulty with the instructions.

    Taking the third link as an example, you would have a little image next to the textbox and you'd add some javascript to that image. You'd have to do it from the codebehind like this

    vb Code:
    1. MyLittleImage1.Attributes.Add("onclick","scwShow(scwID('" + DespatchTextBox0.ClientID + "', event);")

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    5

    Re: Date picker popup calendar in formview

    Thanks for your help.
    I will have a go at this and see how it goes.
    gsrai31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width