Solved

postback and HTML control

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Initial get page response times and IIS8 15 51
cannot connect to sqlserver 8 29
Help with exporting to excel 4 28
Help with adding DLL file in Windows project 20 31
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

803 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