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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:56:23+00:00 2026-05-11T12:56:23+00:00

Hey,…very simple question I usually write php but happen to be programming with ASP.NET

  • 0

Hey,…very simple question

I usually write php but happen to be programming with ASP.NET 3.0 framework now and can’t figure out how to fix this.

I have a DropdownList and if I selected a some value,…my code behind does a bunch of stuff and outputs the data……

Now,…if I reload the page (ie. press F5 or the little reload thing on the browser)….all my data resets as if my selectedIndex is 0….but the actual showing Value is the previous one I selected!…i try to reset the index in my code behind in the ‘if ispostback = false’ statement…but nothing works……it’s like the Value is cached and nothing I can do changes it…

…any help would be appreciated 🙂

(further explanation: ….if print to screen a mydropdownlist.selectedIndex from my Page load Sub…It will return a 0….however the selected index on the screen is clearly not the 0 one….I understand WHY this is happening…i just need to stop it….or at least have a way of determining the index in the view state…)

Andrew

  • 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. 2026-05-11T12:56:23+00:00Added an answer on May 11, 2026 at 12:56 pm

    This is normal behaviour for form fields. Browsers generally try to remember the contents of text fields, the states of checkboxes and the selected items in dropdowns over events like page reload and back/forwards.

    For this reason you should not assume during script initialisation that the values of your form fields will match the content you served up in the HTML. Have the script sniff their current values and set its variables and DOM state up accordingly when the page loads.

    If you really want to throw away all user form field changes on reload/navigation, call form.reset() in the script initialisation to return it to the HTML state. But this can be quite user-unfriendly in normal circumstances.

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

Sidebar

Ask A Question

Stats

  • Questions 304k
  • Answers 304k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Here are a couple of things about json_decode : it… May 13, 2026 at 8:47 pm
  • Editorial Team
    Editorial Team added an answer Try adding a clearing element as the last item in… May 13, 2026 at 8:47 pm
  • Editorial Team
    Editorial Team added an answer The IAsyncResult interface includes an AsyncWaitHandle property of type WaitHandle.… May 13, 2026 at 8:47 pm

Related Questions

Hey everyone, I'm using Virtual PC and working with a virtual hard disk (*.vhd)
Hey so what I want to do is snag the content for the first
Hey, I'm using Levenshteins algorithm to get distance between source and target string. also
Hey all, my Computational Science course this semester is entirely in Java. I was
Hey, I've been developing an application in the windows console with Java, and want

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.