connectseekers.com

Monday, 11 July 2016

Jquery DatePicker Calendar With Week Number in Asp.Net

7/11/2016 - By Pranav Singh 0

This article will show you how you can show the week no of the year in a jQuery datepicker calendar control in asp.net by click on textbox.


So for this article first we will create a new asp.net application and add the below reference into the header of the page.

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

After this we will add the below control into the page.

Date : <asp:TextBox runat="server" ID="txtDate"></asp:TextBox>

After this we will add the below jquery code into the header of the page.

<script>
        $(function () {
            $("#<%=txtDate.ClientID %>").datepicker({
                showWeek: true,
                firstDay: 1
            });
        });
    </script>

So in above code I have make true to show the week no in the date picker. Now here is the complete code of the page.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jQuery-DatePicker.aspx.cs" Inherits="WebApplication7.jQuery_DatePicker" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Jquery DatePicker With Week Number in Asp.Net</title>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <script>
        $(function () {
            $("#<%=txtDate.ClientID %>").datepicker({
                showWeek: true,
                firstDay: 1
            });
        });
    </script>
    <style>
        body{
            font-size:12px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            Date : <asp:TextBox runat="server" ID="txtDate"></asp:TextBox>
        </div>
    </form>
</body>
</html>

Now we have done run the application to check the output.


About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com
Email Id : contact@aspdotnet-pools.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Top jQuery Plugins

Global Classified : Connectseekers.com
© 2014
back to top