Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

postback and HTML control

Posted on 2011-03-06
2
Medium Priority
?
435 Views
Last Modified: 2012-05-11
I have an ASP page.  It has two HTML radio buttons.  When a postback occurs - I think I'm describing this correctly - I lose the selection of the two HTML radio buttons.  This is because the page is being sent again, correct?  How do I save the state of my two HTML radio buttons?
0
Comment
Question by:HLRosenberger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 35046643
If you give each control and "id", "runat" and "enableviewstate" attribute, they will get wrapped as Html server controls and will retain their values. So you definition would be something like:
<input type="radio" name="rb1" value="1" id="rb1" runat="server" enableviewstate="true" />

Open in new window

0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 35047138
Thanks!  That did the trick.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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)

705 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