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 8205469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:15:05+00:00 2026-06-07T08:15:05+00:00

I have a asp:TextBox control and a javascript calendar function associated with it. <asp:TextBox

  • 0

I have a asp:TextBox control and a javascript calendar function associated with it.

<asp:TextBox ID="txtFromDate" ReadOnly="true" runat="server" style="font-family:Verdana; font-size:11px;"></asp:TextBox>
<a href="javascript: void(0);" onmouseover="if (timeoutId) clearTimeout(timeoutId);window.status='Show Calendar';return true;" onmouseout="if (timeoutDelay) calendarTimeout();window.status='';" onclick="g_Calendar.show(event,'formAddCosting.txtFromDate',false); return false;">
<img src="Images/calendar.gif" name="calendarFromDate" width="34" border="0" alt="" /></a>

I can select the date from javascript calendar and display it in the textbox. But when I try to check the date of the textbox for validation in code behind, the dtFrom = Convert.ToDateTime(txtFromDate.Text.ToString()); shows "" during debug. How do I get the value of the textbox from code behind? I am using VB2005, ASP.Net2.0 and C#. Thanks in advance.

  • 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-07T08:15:07+00:00Added an answer on June 7, 2026 at 8:15 am

    That is because your TextBox is readonly: http://www.codeproject.com/Articles/33649/ViewState-and-Readonly-Property-of-Textbox

    So either enable and validate it (if user wants to enter date manually) or use a HiddenField instead to store the date from the calendar.

    I would recommend the first option since it’s always better not to treat the user like a child.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following textbox server control in my web page: <asp:TextBox ID=txtZip runat=server
I have an asp:TextBox that looks like the following <asp:TextBox runat=server AutoPostBack=True ID=txtG1 ontextchanged=txtG1_TextChanged
I have an ASP textbox control where I need to execute some javascript function
I have the following control: <asp:TextBox ID=textbox1 runat=server Width=95px MaxLength=6 /> which i would
I have a asp:UpdatePanel with a asp:Button and a asp:TextBox : <asp:UpdatePanel ID=UpdatePanel1 runat=server>
I have a page setup like so: <ajax:UpdatePanel id=UpdatePanel1 runat=server UpdateMode=Conditional> <ContentTemplate> <asp:TextBox id=TextBox1
This is the code I have: <body> <form id=form1 runat=server> <div> <asp:TextBox ID=txtInsertComments CssClass=expanding
Hi I have created user control for re-sizable text box. <asp:Panel ID=PanelText runat=server CssClass=frameText>
I have a textbox asp.net server control. I am modifying the value of textbox
<%@ Control Language=C# AutoEventWireup=true CodeFile=WebUserControl.ascx.cs Inherits=WebUserControl %> <script type=text/javascript> function Incrementer() { var txtBox

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.