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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:59:58+00:00 2026-05-21T03:59:58+00:00

I’m slowly going mad over the following problem: In my ASP.NET page (target: .NET

  • 0

I’m slowly going mad over the following problem: In my ASP.NET page (target: .NET 4.0) I have the following declaration of a DropDownList:

<asp:DropDownList ID="cmbRequestState" runat="server" EnableViewState="true">
    <asp:ListItem Text="Pending" Value="0"></asp:ListItem>
    <asp:ListItem Text="Open" Value="1"></asp:ListItem>
    <asp:ListItem Text="Closed" Value="2"></asp:ListItem>
</asp:DropDownList> 

In the Page_Load event in code-behind I set the cmbRequestState value to “2” for example – everything’s fine, the value shown in the combo box in the browser is “Closed”, as the respective <option> tag in HTML has the selected="selected" attribute.

Then I select “Open” and perform a postback using a “Save”-button on my page. When I retrieve the SelectedValue for cmbRequestState in the button’s code, it is still “2” even though I’ve selected “1”.

Now I don’t write ASP.NET applications too often, but I do have some knowledge in HTML and PHP programming and from my WinForms and WPF background I’d expect the SelectedValue to contain the value that is currently selected… Also, I do not want to perform a postback every time a user selects a value from the list.

What am I missing here? How would I make sure that when opening the page, the current request state is selected and still get the new selection if the user makes a change?

  • 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-21T03:59:58+00:00Added an answer on May 21, 2026 at 3:59 am

    According to the page lifecycle, the selectedvalue you are assigning in the Page_Load event overwrites the value you are setting in the button’s OnClick event. You should try to match the page lifecycle when assigning values to your controls.

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

Sidebar

Related Questions

I have been unable to fix a problem with Java Unicode and encoding. The
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,

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.