Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

using jquery

Posted on 2013-12-03
1
170 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

792 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