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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:31:55+00:00 2026-06-08T06:31:55+00:00

I have a dropdownlist in my asp.net web page. Its a server side control.

  • 0

I have a dropdownlist in my asp.net web page. Its a server side control. I am doing a ajax call and inside the ajax call I am adding a new item to the ddl and setting it as selected. It is showing nicely on page. But when I do a post back the selected item gives me the old selected item in the dropdownlist.

// ddlCaseNumber is the id of the dropdownlist and its clientid property is set
// to static.
// Removes the selected attribute of selected selected item .
$('#ddlCaseNumber option:selected').removeAttr("selected");

// Add the new item to dropdownlist.
$('#ddlCaseNumber').append('<option selected="selected" value=' + crmid + '>' 
                           + crmid + '</option>');

// Code behind code to get the new value.
// This line is giving the old value instead of giving new value.
string strNewValue = ddlCaseNumber.SelectedItem.Value;

Can anyone please tell me how to get the new item added in code behind?

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-08T06:31:57+00:00Added an answer on June 8, 2026 at 6:31 am

    Items added dynamically on the client will NOT be automatically replicated on the server on a post-back.

    One option is to somehow store that the new items has been added (in something like a <input type="hidden"> or <asp:HiddenField>) and then manually add the item as part of your page Init on the post-back.

    Another option would be to call AJAX to store the information on the server in something like a Session variable, and then again add it manually on the post-back.

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

Sidebar

Related Questions

I have a DropDownList in my asp.net web page. The RequiredFieldValidator is not working.
I have a asp.net 2.0 web site with numerous asp:DropDownList controls. The DropDownList control
I have this unexpected behaviour with an ASP.NET web forms DropDownList. I am adding
I have an ASP.NET DropDownList control that retrieves the first and last name from
I have an ASP.NET webform on which I use a DropDownList control to allow
I'm building an asp.net cutom control inside which I have two dropdownlists: companyIdSelection and
I have a ASP.Net web page with a grid view. I want to filter
I'm using the new Microsoft ASP.NET Ajax ComboBox control in my web application, and
I have a simple ASP.NET web form as below: <form id=form1 runat=server> <asp:TextBox ID=txt
I have an ASP.NET MVC Web Application that interacts with a SQL Server 2008

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.