How to set calendar in textbox in asp.net C#

As pervious we have seen How to set calendar intextbox in asp.net using jquery but if want to called calendar pure by asp.net control with c# then you can use this .Both are good and no problem with both code so you  can use with you convenient .




Source Code:-

<div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:ImageButton ID="ImageButton1" runat="server" Height="17px"
            ImageUrl="~/image/calender.jpg" onclick="ImageButton1_Click" Width="21px" />
<asp:Calendar ID="Calendar1" runat="server"
            onselectionchanged="Calendar1_SelectionChanged" Visible="False">
        </asp:Calendar>
    </div>
   



C# Code:-

protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Calendar1.Visible = true;
    }
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
        Calendar1.Visible = false;
    }





How to set calendar in textbox in asp.net C# How to set calendar in textbox in asp.net C# Reviewed by NEERAJ SRIVASTAVA on 7:38:00 PM Rating: 5

19 comments:

  1. THNK YOU FOR THE POST..

    ReplyDelete
  2. Thanks for sharing such informative guide on .Net technology. This post gives me detailed information about the .net technology. I am working as trainer in leading IT training academy offering Dot Net Training in Chennai and i use your guide to educate my students. .Net Training in Chennai

    ReplyDelete
    Replies
    1. I have read your blog its very attractive and impressive. I like it your blog.

      Digital Marketing Company in Chennai Digital Marketing Agency

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.

      Delete
  4. Very Informative Post..Thanks A lot..Found it much helpful.:)

    ReplyDelete
  5. That was kinda easy to create, thanks, love it. I like to experiment with text boxes from time to time with http://charts.poweredtemplate.com/powerpoint-diagrams-charts/ppt-text-boxes/0/index.html, that is really fun.

    ReplyDelete
  6. Wonderful post. happy to visit your blog. Thanks for sharing.

    seo training center in chennai

    ReplyDelete
  7. thank a lot its working perfectly

    ReplyDelete
  8. Thanks for sharing the information and keep updating us.This information is really helpful to you.
    SEO Training in Chennai | SEO Course in Chennai | SEO Training Chennai

    ReplyDelete
  9. Digital Marketing is a kind of marketing strategy that relies on electronic medium like television, internet and mobile in promoting a product. It delivers incredible result to the business owners to boost their business online presence and enjoy maximum leads. Digital Marketing Training in Chennai | Digital Marketing Course in Chennai

    ReplyDelete
  10. I am not getting calender near text box

    ReplyDelete
  11. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Ios training in chennai

    ReplyDelete
  12. Dot Net is the best programming language ever. your blog have explained the excellent concept which help me to

    gain more info on C# programming language.

    Dot Net Training in Chennai |
    .NET Training in Chennai

    ReplyDelete

Powered by Blogger.