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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:35:53+00:00 2026-05-23T14:35:53+00:00

I have a aspx Page where I am using AJAX. like <asp:UpdatePanel runat=server ID=upPanelDDLProgram>

  • 0

I have a aspx Page where I am using AJAX. like

<asp:UpdatePanel runat="server" ID="upPanelDDLProgram">
  <ContentTemplate>
    <asp:DropDownList ID="DDLProgram" runat="server" Width="194px" Height="18px" OnSelectedIndexChanged="OnDDLProgramChanged" AutoPostBack="true">
    </asp:DropDownList>
  </ContentTemplate>
</asp:UpdatePanel> 

and my code behind is like

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        //{
        //    BindProgramDDL();
        //}
        BindProgramDDL();
    }

    protected void BindProgramDDL()
    {
        List<CcProgramEntity> programEntities = FormSaleSubmit_BAO.GetAllPrograms();

        DDLProgram.DataSource = programEntities;
        DDLProgram.DataTextField = "Shortname";
        DDLProgram.DataValueField = "Id";
        DDLProgram.DataBind();
        string programCode = programEntities[DDLProgram.SelectedIndex].Code;
    }

    protected void OnDDLProgramChanged(object sender, EventArgs e)
    {
        List<CcProgramEntity> programEntities = FormSaleSubmit_BAO.GetAllPrograms();
        string programCode = programEntities[DDLProgram.SelectedIndex].Code;
    }

the If condition is the page load event, is commented out. If I toggle the comment part of the page load event, it works perfect in both cases. My question is why is this heppening?

  • 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-23T14:35:54+00:00Added an answer on May 23, 2026 at 2:35 pm

    If I am getting you correct …….

    DropDown list has data even you are not binding it second time after post back……….its becasuse its server side control and each serverside control has its view state with it thats y its not removing data.

    IsPostBack – it true when do the post back by using serverside control like dropdown, checkbox , textbox…………When you load page first time this property is false but in subsequent request to same page value of this property is true. you can check msdn document for more detail about it.

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

Sidebar

Related Questions

I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have code like this on some aspx page in my Web Application: <asp:Content
I have an aspx page that makes an Ajax request (using jquery) to a
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I have an ASPX page where I am uploading an image to server for
I am using jquery ajax method on my aspx page,which will invoke the webmethod
Using this tutorial: http://dotnetslackers.com/articles/ajax/Using-jQuery-with-ASP-NET.aspx The web service is invoked such as Service1.asmx/HelloToYou The default
In VS2010 I have VB.NET codebehind aspx pages and I'm using Ajax multihandleslider extensions
I am doing Ajax call using jQuery and my URL is like http://localhost;3327/DummyAps/Demo.aspx In
I'm using the AutoCompleteExtender from the AJAX control toolkit on my aspx page -

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.