[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Can elements maintain state after postback

Posted on 2006-05-21
Medium Priority
Last Modified: 2010-05-19
Is there a way to maintain the current state of an html element (whether it's checked or unchecked) when you post back a page? If so, could someone provide an example? None of these elements are in the code behind file, so using Not IsPostBack won't work, unless there's a way to place them there.

Right now, when my page refreshes, all the elements are reset to their defaults.

Question by:barnesco

Assisted Solution

Krule earned 200 total points
ID: 16730031
Can you post details as to what server side language you are using? Looks like ASP with some VBScript.

The only way, to my knowledge, to save state between refreshes is to somehow post the data to a form, then populate the state of the objects using the form data.  
LVL 75

Accepted Solution

Michel Plungjan earned 1400 total points
ID: 16730193
How about a cookie?
LVL 41

Assisted Solution

HonorGod earned 400 total points
ID: 16730505
You could using something like cookies, or a database

Author Comment

ID: 16765551
Hadn't thought about cookies and using a database might be even better. I've been using hidden variables on page.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question