.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Working with datepicker and input controls

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

Helloe all,

Please I'm developing a hotel reservation system and I have both "check in" and "check out" html "input"controls and I have linked these controls to the Jquery datepicker. Unfortunately, I'm not able to access the value of the controls in asp code behind (using their ids CheckInDate and CheckOutDate respectively).

Previously, I used asp textboxes and I was able to access the IDs in code behind but whenever the page displays and I click in any of the textboxes their respective datepicker don't show.

However, I'm able to access the html input controls in code behind when I add runat="server" but when I do that the datepicker don't show for both control when I click in the input boxes.

Someone help me so that I will be able to make the datepicker show as well as fetching/accessing the value of the input boxes (selected dates) in the code behind...... or how to use asp controls and add onclick functions to call the datepicker.

Thank you.


<script type="text/javascript">
        $(function() {       
        $("#CheckInDate").datepicker({ minDate: 0, maxDate: '+1M' });

View Complete Post

More Related Resource Links

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

UI Datepicker and web user controls



I have developed an application using the Master-Detail pattern described in this Matt Berseth article.

The only difference between Matt's article and me is that I am using a FormView object in place of a DetailsView.

Everything works fine except that the formview object, in my case it's inside a user control and I can't figure out how to use the jquery datepicker UI plugin.

I have tried to put the script block for the datepicker either in the aspx page as well as inside the user control but in both cases the calendar does not come up when the related textbox get the focus.

Any suggestion on how to work with the datepicker inside an ascx?

thanks in advance!

Enabling/disabling input controls in a form

I am writing a ASP.NET UserControl and I am trying to incorporate JQuery into this.
The control is a simple form with a few input fields (text, checkbox, select, radio).
The first element in the form is a checkbox. Upon clicking this checkbox I want the all the input elements in the form (except the checkbox control itself) to be enable/disable. I tried writing some of this code but my solution was not getting me anywhere.
Below is the ASP.NET form code. I'd appreciate the help with some code or pointers into what I am doing wrong.
 <asp:Panel ID="pnlInputControls" runat="server">
    <table style="width:100%;">
            <td style="width:50%">
                <asp:CheckBox ID="chkBenefitName" runat="server" Checked="true" TextAlign="Right" ClientIDMode="AutoID" style="padding:0 0 0

Enter the date on the WPF DatePicker input textbox instead

When i type in the date on the date picker and check it on an lostfocus event and i try to read the text or selecteddate its blank?  Am i missing something.  I assumed typing in 5/11/2010 on the input box would either show up on the controls Text or the SelectedDate, but i may be missing something   Thanks

Keypress Event for Input not working

HelloI use code below code to call function "search" but it only works when users click on button. Keypress event for input does not working.Culd any one plesae tell me why? <input type="text" name="q" id="q" onkeypress="if(event.keyCode==13) FillForm();" autocomplete="off" /> <input type="button" value="Go" onclick="FillForm()" />

Login controls not working in VS2008



I am creating a asp.net 3.5 app using VS2008 on a Vista Ultimate machine. I wanted to add the login features using the login controls. I was able to create users and roles without any problem using the web admin tool that comes with VS. But when I try to login using the same credentials I am always getting "Your login attempt was not successful. Please try again." error message. I am using MS Sqlserver 2008 as the backend. I am not using any .mdf or sqlexpress databases. I even deletd the App_Data folder. In sqlprofiler, I see the web admin tool is connecting, but when I try to login using the login control, it doesn't even show up on the sql profiler. I tried to launch VS 2008 as an admin, still no success. I tried to browse with IE or FireFox. The dev site is not hosted on IIS yet, and it is running on the dev server that comes with VS 2008. I have squandered nearly one week on this issue. Ironically I was able to to create a website last year with these same controls on VS2005 and Windows XP professional, and the site is running like a charm!

The following is the entry in my web.config file:

<membership defaultProvider="SqlMembershipProvider1"

Multiple issues with dropdown list controls not working correctly


I am using WSS 3.0 and SharePoint Designer.  I have modified one of the items in my NewForm page so that I have a filtered lookup using a spdatasource. The filter works great, but my issue is that I can't seem to save the users selection back to the list itself.

Issue when using an ASP.NET dropdown list
I am able to bind the filtered spdatasource to an ASP.NET dropdown list control, however the item that is selected in the dropdown list is not being saved back to the list.  I am guessing that this is because the dropdown list itself is not tied directly to the appropriate list item, but... I can't seem to figure out how or where to do this.  I don't see anything in the data properties box in SharePoint Designer that allows me to tie the data back to the list itself.  Maybe I am just overlooking it somewhere?

Issue when using the native SharePoint Data View DropDownList with a filtered spdatasource
When I select "Data Fields..." on the dropdown control I get the Change Data Bindings dialog box.  From here I can select a data field to save the value back to (which resolves the issue noted for the asp.net control) and I can select my spdatasource, but... the display text and value fields below that never populate.  Thus, the dropdown list is empty when the user is filling ou

AJAX Controls not working....


I have a simple under construction page that I am working on for my company website and I am trying to apply the rounded corners extender to a panel at the top of the page for my title.  But when I put the extender on the page and set it up for the panel that holds my title and then view the page in my development environment I get a blank page.  When the page first loads you can see the title panel flash and it disappears.  Below is my code...

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

My user controls stopped working in Design mode! Why?


I have a few user controls that I have been using for months but now whenever I open a page in Blend that uses one of the controls I get an invalid xaml error. The project still compiles and runs and behaves just like it's supposed to but I can't edit xaml in Design view because of this error.


In the page I have

<local:ACAVariableWidth x:Name="CIDCloseButton" HorizontalAlignment="Right" Margin="0,0,17.54,15" VerticalAlignment="Bottom" Width="174" Height="89" MouseLeftButtonDown="callerID_close" Text="Close"/>

The error is: The member "Text" is not recognized or is not accessible

In the user control xaml I have:

		<StackPanel x:Name="TopSP" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center" Height="76" d:IsLocked="True">
			<TextBlock x:Name="ACATB" Margin="8,8,8.5,9.5" FontFamily="APHont" FontSize="32" Padding="5,0" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding ElementName=UserControl, Path=Text}" d:IsLocked="True">
					<DropShadowEffect Direction=&

Having multiple UpdateProgress controls working


I have an application that is using TabContainers and TabPanels. Within each TabPanel I have a DropDownList and a GridView. The GridView is filled on "SelectedIndexChanged" event.

I have managed to get UpdatePanel and UpdateProgress working for one on the instances but I do not seem to have luck implementing additional UpdateProgress controls for the rest on the application.

I have tried to use "AssociatedUpdatePanelId" but read that external trigger will not work. I've also tried to assign each UpdateProgress value of UpdatePanel in code behind (

UpdateProgress1.AssociatedUpdatePanelID = UpdatePanel1.UniqueID)

 , not working for me either:

I have created a Java SCript that hides GridView when UpdateProgress is being shown (works fine too)

This is what I have (and working):



<script type="text/javascript">
      window.onload = function() {
          var prm = Sys.WebForms.PageRequestManager.getInstance();
          if (prm != null) {
              prm.add_beginRequest(function(sender, e) {
                  var gridView = document.getElementById("<%=GridView2.ClientID %>");
                  if (gridVi

Paging not working with two controls- Dropdownlist & Listview


So I am using EW + Access database to create a page.

This page contains two controls. First control is Dropdownlist which databinds with second control Listview.

This listview has paging on becuse of multiple pages. If I don't use QueryStringField paging works but if I use QueryStringField paging doesn't work and it goes back to first option of Dropdownlist.

I need paging to access specific records.

Can anybody help me with this issue.

Thx in advance!!

jquery datepicker not working in dialog



I have an ajax call that opens a dialog that contains a datepicker. The call looks like this:

            type: "GET",
            url: encodeURI('<%: Url.Action("action", "controller") %>'),
            cache: false,
            dataType: 'html',
            error: function (XMLHttpRequest, textStatus, errorThrown) { $("#dialog").html(errorThrown); },
            success: function (data, textStatus, XMLHttpRequest) {
            complete: function (XMLHttpRequest, textStatus) {

function openCalendar() {
        $('#EndDate').live('click', function () {
            $(this, document).datepicker({ showOn: 'both' }).focus();

The picker opens ok on click but when I try to select some day it won't set the day in the input field and it won't close also.

Thank you in advance

Advice Needed: 1-8 lines of repeating input controls - How should I do it?


Based on dynamic data, I'm going to have to display 1-8 rows of data input controls (a check box and several text boxes per row) and obtain input for all the rows I display.

I don't think a GridView is the way to do that (although if it is, please help educate me on why).  Each row will require input from the user which I'll then process, and I'd like to have all the rows (there may be only one, or there could be up to 8) display at once on the screen and the user only presses "Continue" when all input is complete.

What's the best way to accomplish this?  Can you point me to an example of how I might accomplish this?

Thanks in advance,


#Eval in server side controls not working (ERROR:too many character in literal)



i have grideview and i want to bind silverlight media control as follow


<asp:Media...etc MediaSource="<%#Eval('Source')%>"




All TextBox controls in ASP.NET UpdatePanel won't accept any input after post-back


 My code behind is VB.NET. I use ASP.NET UpdatePanel like the following. However, after the post-back, all textbox in UpdatePanel won't accept any input, except when I move the mouse over and click on the TextBox.

  • Here's why I use UpdatePanel:

    During the post-back, after inserting data into DB, set all TextBox text property to String.Empty

    After the form is submitted, the Panel pStudent should be refresh , not the entire page

    and the TextBox txtId is set in focus again.

It's very strange that this happened to me today. I used UpdatePanel before many time I never had such problem.

Can anyone show me why  all TextBox controls in UpdatePanel won't accept any input after the post-back even though the textbox is focused , only when you move mouse click in them? 

    <asp:UpdatePanel ID="upPOS" runat="server">
            <asp:Panel ID="pStudent" runat="server" CssClass="InContentInfoLight" 
        DefaultButton="btnSubmit" GroupingText="Cafeteria - POS">
                <br />
                <div class ="divleftcolumn-six">
                    ID Number :
                    <asp:TextBox ID

Tabs and dropdown controls are not working when browsing sharepoint 2007 central administration sit



I have installed sharepoint server 2007 sp2  on 64 bit WS 2008 standard edision server. I have IE8 installed on the server. When i browse the central administration site, non of tabs, drop down will work.  For example when i go to create a web application and put all the things and hit "OK" button, nothing happens. But if i replace the url with "localhost", everything works fine.

for example if my central admin url is "http"//servername:1000"- Controls will not work.

But if i use http://localhost:1000 - everythign works fine.

Any suggestion is helpful.


Master page controls postback is not working with updatepanel


?Hi All,

I have a web page that contains an updatepanel, inside this there is a button with script in OnClick event.

While clicking the button am setting a text in the label control which is in the site.master

My problem is that label is not showing the text am setting (or postback for master control is not working).

Without updatepanel label is coming.


Thanks in advance



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend