Solved

postback and HTML control

Posted on 2011-03-06
2
427 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 500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

752 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