Solved

using jquery

Posted on 2013-12-03
1
161 Views
Last Modified: 2013-12-13
How would I use this on server control?

<label for="from">From</label>

<input type="text" id="txtfrom" name="from" runat="server">

<label for="to">to</label>

<input type="text" id="txtto" name="to" runat="server">

See this
0
Comment
Question by:VBdotnet2005
1 Comment
 
LVL 27

Accepted Solution

by:
Chinmay Patel earned 500 total points
ID: 39694608
You need to add the following script in your ASP.Net page

<script>

  $(function() {

    $( "#<% this.FromTextBox.Id %>" ).datepicker({

      defaultDate: "+1w",

      changeMonth: true,

      numberOfMonths: 3,

      onClose: function( selectedDate ) {

        $( "#" ).datepicker( "option", "minDate", selectedDate );

      }

    });

    $( "#<% this.ToTextBox.Id %>" ).datepicker({

      defaultDate: "+1w",

      changeMonth: true,

      numberOfMonths: 3,

      onClose: function( selectedDate ) {

        $( "#<% this.FromTextBox.Id %>" ).datepicker( "option", "maxDate", selectedDate );

      }

    });

  });

  </script>

Open in new window


And simply add two asp.net text boxes on your page with name ToTextBox and FromTextBox

Regards,
Chinmay.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now