Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

using jquery

Posted on 2013-12-03
1
Medium Priority
?
183 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

971 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