We help IT Professionals succeed at work.

What should be the ideal behavior of a ASP.NET page when Refresh button is clicked?

Last Modified: 2010-03-26
Hi all,
Scenario: If there is a dropdownbox having the three values: "Add, Subtract, Multiply" and there is a Checkboxlist with the same 3 values. If the user selects "Add" option in the dropdownlist, then the item "Add" in the Checkboxlist needs to be removed. If the user selects "Subtract" option in the dropdownlist, then "Add" item should be added to the checkboxlist and "Subtract" item needs to be removed.

In this scenario, assume that the user selected "Add" option, and "Add" option in the checkboxes gets removed accordingly.  Now if the user clicks on Refresh button, the "Add" checkbox also gets displayed in the page. Is this correct in the real world when the user clicks on Refresh button? Or should the option selected by the user should be maintained?

Just to clarify:
I would like to know if the option chosen by the user (for eg: any option in a RadioButton or Listbox or DropDown or in the example scenario above) should be maintained in the view state and display the options exactly chosen by the user when the "Refresh button" is clicked? Or is it fine to clear the values?

Would really appreciate any feedback from you guys.
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)


Hi Vincent,
Thanks a lot for your comment. Alrite, I am gonna just ignore this behavior.
Yes, Vincent, the user can manually select a few options! (Is this what you are not sure, I am sorry, I dont get this part of your comment.
<quote VincentPuglia>
Based on what you say above, I'm unable to tell if the user can manually select/check options so that all of the selects/checkboxes are unselected.
This one is on us!
(Get your first solution completely free - no credit card required)


Hi Vincent,
Many thanks for your comment.

No, I wasnt talking about preferences.

Just the web controls/selections.

Now that you've told me your point of view as an user, I would take that as an OK from UAT :)

Alright, so let me not worry about this anymore.

Thanks again for explanation and telling what you'd prefer.

Have a nice day,

no prob & you do the same :)


Thanks Vincent.!


I've graded your excellent soln Vincent.
Thanks once again!! :)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.