Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8211167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:20:17+00:00 2026-06-07T10:20:17+00:00

I am using the jQuery DatePicker control. The control displays properly but I am

  • 0

I am using the jQuery DatePicker control. The control displays properly but I am unable to get the selected value in my code behind page. I attempt to capture the user-selected value using: DateTime StartDt = Convert.ToDateTime(Request.Form[“datepicker”]); The user has several controls to select and then hits submit.

After submitting, when I inspect that value of StartDt it is: 01/01/0001 00:00:00AM

ASPX page:

<%@ Page Title="Fox Cities Restaurant Guide-Food Events" Language="C#" MasterPageFile="~/main_master.Master" AutoEventWireup="true" CodeBehind="Events.aspx.cs" Inherits="FCGuide.Events" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Styles/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript">
     $(document).ready(function () {
         $("#datepicker").datepicker();
     });
  </script>
    <style type="text/css">
        #datepicker
        {
            width: 110px;
            height: 19px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="defaultEvent">
        <div id="EventNav">
            <div id="EventType" class="EventNavDivs">
            <span class="EventTitle">Event Type</span> <br />
                <asp:DropDownList ID="ddlEventType" runat="server">
                    <asp:ListItem>Any Event</asp:ListItem>
                    <asp:ListItem>Art Shows</asp:ListItem>
                    <asp:ListItem>Farmers' Market</asp:ListItem>
                    <asp:ListItem>Festival</asp:ListItem>
                    <asp:ListItem>Restaurant Opening</asp:ListItem>
                </asp:DropDownList>
            </div>
            <div id="EventDate" class="EventNavDivs">
                <span class="EventTitle">Event Date</span> <br />
                <%--<asp:TextBox ID="datepicker" runat="server"></asp:TextBox>--%>
                <input id="datepicker" type="text" size="50px" maxlength="12" />
            </div>
            <div id="EventLocation" class="EventNavDivs">
                <span class="EventTitle">Location</span> <br />
                <asp:DropDownList ID="ddlEventCity" runat="server">
                </asp:DropDownList>
            </div>
            <div id="EventBtn" class="EventNavBtn">
                <br /><asp:Button ID="btnFindEvents" runat="server" Text="Submit" 
                    onclick="btnFindEvents_Click" />
            </div>
        </div>
        </div>
    </div>
</asp:Content>

Code Behind page:

protected void btnFindEvents_Click(object sender, EventArgs e)
{
    string EventType = ddlEventType.SelectedValue;
    DateTime StartDt = Convert.ToDateTime(Request.Form["datepicker"]);
    string City = ddlEventCity.SelectedValue;

        BLgetEvents obj = new BLgetEvents();
        var EventList = obj.getAllEvents(StartDt);

        ListEvents.DataSource = EventList;
        ListEvents.DataBind();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:20:20+00:00Added an answer on June 7, 2026 at 10:20 am

    change your .aspx code to this:

    <input id="datepicker" type="text" size="50px" maxlength="12" name="DatePickername" />
    

    then in your codebehind, do:

     string dt = Request.Form["DatePickername"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery Datepicker but I'm having trouble when editing records. // js code
I was tring to create a simple datepicker control using JQuery, but i was
I'm using jQuery UI's datepicker control in a position: fixed toolbar at the bottom
I have a datepicker control setup using the JQuery UI, I am also using
I am using jquery datepicker, please see below code $(document).ready(function() { $(.txtDate).datepicker({ showOn: 'button',
I'm using the jQuery DatePicker control for the first time. I've got it working
I am using the datepicker control from jQuery-ui 1.8. from-date is a text input.
How to get clientID of Datalist control using jquery , I tried using the
I've got a page that is using jQuery. $(#start_date).val() The above code returns the
I'm using a aspx file because of my ReportViewer control and my jQuery datepicker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.