can i use a calendar picker control in my form without it posting back the page when i pick or change the date?

can i use a calendar picker control in my form without it posting back the page when i pick or change the date?

8/29/2007 9:39:25 AM 93655 articles. 5 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 25

8/29/2007 10:24:43 AM


can i use a calendar picker control in my form without it posting back the page when i pick or change the date?



Based on my understanding, you can try to use JavaScript to solve your problem.

Also I write a demo for your reference only; Please look at the part of "bold";


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CalendarDemo.aspx.cs" Inherits="CalendarDemo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" >
<head runat="server">
    <title>Calendar Demo</title>
    <script language="javascript" type="text/javascript">
       function OnMouseMoveOperation(dateValue){document.getElementById('TextBox1').value = dateValue;}     
    <form id="form1" runat="server">
        <asp:Calendar ID="Calendar1" SelectionMode="None" runat="server" OnDayRender="Calendar1_DayRender">
        <asp:TextBox ID="TextBox1" runat="server" Width="252px"></asp:TextBox></div>


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class September_HtmlGenericControl : System.Web.UI.Page
    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
        //Split JavaScript
        e.Cell.Text = "<div onmouseover=\"OnMouseMoveOperation('" + e.Day.Date.ToString("yyyy-MM-dd") + "')\" onclick=\"OnMouseMoveOperation('" + e.Day.Date.ToString("yyyy-MM-dd") + "')\">" + e.Day.Date.Day + "<div>";

Now, your tasks as follows:

1.Create a WebForm named "CalendarDemo"

2.Paste the code to the WebForm

3.Run and see the result Cool

Please correct me if I have misunderstood your mean, please LET ME KNOW. Thanks,

Hope it helps,

Hong Gang




Hong-Gang Chen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
9/3/2007 6:44:18 AM

thanks very much this has solved problem

9/3/2007 9:48:50 AM

Similar Artilces:

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: might ...

can someone one give me difference between web form and mobile web form and which or where or when i'm using the forms?
thanks Marc Hi Marc, Based on my understanding, you want to know the differences between the ASP.NET web application and ASP.NET mobile web application. If I have misunderstood you, please feel free to let me know. The ASP.NET forms are used to develop the ASP.NET pages for desktop browsers and The ASP.NET mobile forms are used to develop the ASP.NET pages for mobile device browsers. When we create the ASP.NET mobile web forms pages, we can use nearly all the features of ASP.NET. But there are a couple of compatibility issues: Error Handling and Reporting. Tracing. Using Redi...

Can you post a page back to the server without a form?
Can you post a page back to the server without a form from the HTML side? What are my options?  I am using Sharepoint with webparts that do not have a form in the code. I need to seperate a few things/functions based on some criteria that I can't get unless I submit the page back to the server.   any suggestions? Not sure if this is useful to help get me an answer But something like onclick="__doPostBack('CheckBox1','') but I all I want to do is post the entire page back....I dont care about checkboxes or txt boxes.  Just posting it back to s...

Implementing .Net Form into an web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

How to preserve values in a web form when navigating to a different page and then going back to the original page using the back button ?
   I am working on a C#/ASP.NET web application. The web application basically consist of 3 web forms. Each form contains several controls such as an edit box, and some drop down list box controls. Basically I need to find out how to preserve the values in a web form when a person navigates to a different page. For example, suppose that in my web application I navigate from my first page (First.aspx) to my second page (Second.aspx). Now if I press the browsers back button, I want the application to retain the values for the controls that were in my first web form "first....

Can't use "defaultbutton" in <form></form> tag in login control page.
I have a login control and I tried to set the default button as the submit button within my form tag in the login page.But, I am getting the following error.Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. I already generated the machine key.Any clue! hi robin, Please try this fix if.. add the below given code into your web.config or the file that you are executing and see if your issue gets...

Using Win Form controls in web forms
Hi All,   Please tell me if i can't use the window forms controls in my webform. What if i simply import the Namespace. Definitely this will help me to expose the class & methods, but will they work accordingly when get rendered. I am totally confused.. please help me. Thanks Simple answer:  You can't.  Webforms controls render as HTML; while this may be possible to achieve with Winforms controls by invoking the design-time rendering, I doubt it's going to work very well.What control are you trying to use?Peter BrunoneMS MVP, ASP.NETFounder, Easy...

Insert form without using form control
Hi I would like to build a form without using a form control ie, formview, gridview, detailsview.  With the following code I don't get an error message but when I hit the form button the record doesn't get inserted into my table.  Is there code that I have to add to my code behind maybe on the button click event that I have to add to insert the record?  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="InsertForm.aspx.cs" Inherits="InsertForm" %><html xmlns="" ...

Could PB .NET Web Form POST security Information to others web page??
This is a multi-part message in MIME format. ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi,=20 Have anyone came across the requesion to POST security informations from = PB .NET web form web page to other web site?? I have tried many datys, Could any kind man give me some suggessions?? thanks & Best regards Leon ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML P...

how to use form tag in the content page while master page form tag is in use?
Hi there, i have created a bug report form in the content page which uses the master page template. In the master page i am using the menu which should be in the form tag. when i use the form tag in the content it gives me the error as cant use more than one form tag. how can i resolve it. i hav searched in this forum for tht.. i got links which says to disable the content page form tag as form.visible= false. In my situation i cant disable any of the form tag either inthe master page( menu with in the form tag) or content page ( bug report form with server controls with...

need to set enctype in form tag of the content page
I can't use more than one Form tag how can I make this work???? Thanks,  Newbie   here is my code for the content page: <asp:Content ID="ContentFileUpload" ContentPlaceHolderID="DefaultMasterPageContentPlaceHolder" Runat="Server"> <script src="../ScriptLibrary/FileUpload.js" type="text/javascript"></script><!-- ENCTYPE - in most cases you will not need to use this attribute at all. The default value is "application/x-www-form-urlencoded", which is sufficient for almost any kind of form dat...

For interrupting.web form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form
Web Form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form ! Because of my pool English, if you can't see , I will explain more ! ThanksGambler is the real life I guess you mean when form grows it also grow parent div element. This is normal. If you want div to stay fixed size and rather clip the form and maybe show a scrollbar, look at overflow property in CSS.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no ...

How can I add a calendar on web form or page?
I am developing a web application using csharp code on Microsoft .net Framework 1.1.  I am using Visual studio 2003. The question is as follows; How can I add calendar on web form so that when a user wants to enter date he/she clicks on the icon or link then calendar pop ups   then select the actual date. Please help Hi, use jQuery UI Datepicker. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons....

user control data entry form, use same codebehind as web form?
Hi All, I have a quesiton about the approach I'm taking. I have a series of report forms which I have been in the process of consolidating to a single, generic page and subs/functions in a single code-behind. All the reports can use the same set of data entry elements (a dropdown, a radio list, and a textbox). I'm trying to convert these elements to a user control. However, this user control seems to need to inherit differently than the rest of the code-behind. I've been using a single class in the code behind. Is it feasible to separate out the data entry? the code behind im...

Web resources about - can i use a calendar picker control in my form without it posting back the page when i pick or change the date? -

The beard calendar
How am I not in this? ∞ Read this on The Loop

Calendar (application) - Wikipedia, the free encyclopedia
"iCal" redirects here. For the standard file format for addresses and calendar entries, see iCalendar . For other uses, see Ical . Calendar , ...

You can now create and manage reminders in Google Calendar
Youve been able to create and manage your events on Google Calendar since its launch on iOS last March. But now, Google has made it easier for ...

At last! Google Calendar gains to-do lists with Reminders
When it comes to keeping on top of appointments, Google Calendar is certainly a useful tool but it's a long way from perfect. It's very capable ...

Introducing the new Calendar Resource API
... Work and Wesley Chun , Developer Advocate, Google Apps Over the years, we’ve been updating our APIs with new versions across Drive and Calendar, ...

Reminders in Google Calendar
Google Calendar's apps for Android and iOS now let you add reminders, just like you can do using Google Keep, Google Search or Google Inbox. ...

Calendar: Week of December 14 - Videos - CBS News
From the unveiling of Merriam-Webster's Top 10 Words of the Year, to the unveiling of "Star Wars: The Force Awakens" - "Sunday Morning" takes ...

Google adds to-do lists to Calendar
The updates lets you set reminders in your calendar

A-Zdvent calendar: University of Limerick Living Bridge by Wilkinson Eyre
As we enter the final week of our bridge countdown, we're spotlighting the University of Limerick Living Bridge in Ireland by Wilkinson Eyre ...

Planning Your 2016 Content Marketing Calendar
Planning Your 2016 Content Marketing Calendar written by Guest Post read more at Duct Tape Marketing There are only a few weeks left in 2015, ...

Resources last updated: 12/26/2015 4:44:09 AM