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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:12:44+00:00 2026-05-22T03:12:44+00:00

i have two text box controls with calender extender and a dropdownlist as follows.

  • 0

i have two text box controls with calender extender and a dropdownlist as follows.

<asp:TextBox ID="txtStartDate" runat="server" ReadOnly="True"></asp:TextBox>

<asp:CalendarExtender ID="CalendarExtender1" TargetControlID="txtStartDate" 
    runat="server" Format="yyyy-MM-dd" />

<asp:TextBox ID="txtEndDate" runat="server" ReadOnly="True" 
             ontextchanged="txtEndDate_TextChanged">
</asp:TextBox>

<asp:CalendarExtender ID="txtEndDate_CalendarExtender" runat="server" 
                       Enabled="True" TargetControlID="txtEndDate" Format="yyyy-MM-dd">
</asp:CalendarExtender>

<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>

What i want to do is when user selects a date in txtEndDate i want to call a function to load data in DropDownList1, i.e DataBind DropDownList1.

When i Set AutoPostBack property of txtEndDate to True and call a method on txtEndDate_TextChanged the event does not get fired.

Where am i going wrong can anyone help. I just want to load DropDownList1 when user selects a date in txtEndDate. What do i have to do.

here is what i had done in my aspx.cs

using System;
using System.Data;
using System.Configuration;
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 _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String DB = "";
            String AccountID = "";
            if (Session["login"] != null && Session["db"] != null)
            {
                AccountID = Session["login"].ToString();
                DB = Session["db"].ToString();

                Label4.Text = AccountID;
            }
            else
            {
                Response.Redirect("log.aspx");
            }
        }
    }
    protected void txtEndDate_TextChanged(object sender, EventArgs e)
    {
       String databs = Session["db"].ToString();
       Response.Write(databs);
        ddlist1_crtno a = new ddlist1_crtno();
        a.filldropdown1(this.DropDownList1, databs);
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        // LOG OUT***********////////////
        Session.Abandon();
        Response.Redirect("log.aspx");  
    }
}

I put the same event on ButtonClick event and everything worked fine.

  • 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-05-22T03:12:44+00:00Added an answer on May 22, 2026 at 3:12 am

    Try and remove the ReadOnly="true" from the TextBox control. This might solve your problem.

    There is a problem with the TextBox controls having ReadOnly="true" that the value of the textbox is lost whenever PostBack happens and that is the reason why the event isn’t firing.

    Edit: It is a known issue with the textboxes which has no solution to it yet. there obviously are workarounds to it.

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

Sidebar

Related Questions

I have a text box with event name and two calendar controls to get
I have two controls: list box text box The list box binds its data
I have user control named DateTimeUC which has two textboxes on its markup: <asp:TextBox
I use VS2010,C# to develop ASP.NET web app, I have some two text boxes,
I have two list controls in my asp.net page and am populating the second
I have two CheckBoxes and a TextBox. I want to TextBox to have IsEnabled=False
I have a webpage where there are two buttons and a textbox. When the
I have two text boxes t1 and t2 in an html page. I'd like
i have two text inputs like the following, i don't want to use <form>
I have two text files that contain columnar data of the variety position -

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.