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

  • Home
  • SEARCH
  • 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 9169983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:57:14+00:00 2026-06-17T15:57:14+00:00

I have a DropDownList which i am binding on page load. i dont have

  • 0

I have a DropDownList which i am binding on page load. i dont have any buttons or anything. as soon as user selects the value in dropdown i need to show that value in label. i am not sure why this is not working. please help.

public string SelectedStore { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
  if (!Page.IsPostBack)
      {
          BindStoresList();
      }
}
 protected void BindStoresList()
 {  storeDDList.AppendDataBoundItems = true;
    storeDDList.Items.Add(new ListItem("Select store", "-1"));
    TempCollection stores = TempDataSource.LoadForCriteria("ALL", "Code ASC");
    storeDDList.DataSource = stores;
    storeDDList.DataTextField = "DisplayName";
    storeDDList.DataValueField = "Code";
   storeDDList.DataBind();
 }
  protected void storeDDList_SelectedIndexChanged(object sender, EventArgs e)
   {
     SelectedStore = storeDDList.SelectedValue.ToString();
     selectedItem.Text = SelectedStore;
   }

I dont need any kind of jquery stuff as i am going to add gridview which binds depending on the value of dropdown..

****** EDITS *******

if i set AutoPostBack=True then on page refresh my DropDownList doesn’t bind at all as you can see in Page_Load Method, it will not call BindStoresList() method.

***** ANSWER *****

For people who might get stuck with this..

i was setting the EnableViewState to True for the DropDownList, so after page refreshes the SelectedValue was getting lost. after removing the EnableviewState and setting AutoPostBack to Ture working 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-06-17T15:57:15+00:00Added an answer on June 17, 2026 at 3:57 pm

    You have to set the AutoPostBack=True for the dropdown, it will automatically send the call to server side without need to extra button.

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

Sidebar

Related Questions

I have a dropdownlist which lists Country names When user select any country from
I have dropdownlist,which get filled from table1.That table1 has Zero value.While filling the dropdown,want
I have asp:DropDownList control which i want to display data to user who don't
I have a page which has an Html.DropDownList which takes in a viewdata parameter.
I have a dropdownlist box, from which a user makes a selection. However, I
Suppose i have a dropdownlist in which whole months are there in that dropdown.I
On my page I have a DropDownList which I populate with database values from
I have a dropdownlist in asp.net mvc which is bound using the normal binding
I have a dropdownlist (on Page) which has OnSelectedIndexChange event thats Loads different Control
I have a dropdownlist which i'm binding to DataTable. ddlItems.DataSource = dt; ddlItems.DataBind(); in

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.