?
Solved

Layout Options for ASP.net Radio Buttons

Posted on 2005-03-21
8
Medium Priority
?
232 Views
Last Modified: 2012-05-05
I have a survey form created with the layout I want.  Now I need to convert my HTML <inputs> to radio button lists (each row is a new group).  

The reason I need to convert to ASP.net radios is because I need to preserve my viewstate if an error occurs.  Right now, an error occurs and the form is reset when a radio group is unanswered.  

Example at: http://nicic.org/applications/surveys/NeedsAssessment/Default2.aspx?Section=4
0
Comment
Question by:stengelj
[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
  • 4
  • 3
8 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13598024
stengelj,

I have moved this to the ASP.NET topic where I think you have a better chance of getting a solution.

COBOLdinosaur
Page Editor, Web Languages.
0
 
LVL 9

Author Comment

by:stengelj
ID: 13598441
Thank you.  I get confused between "Web Dev" and "Programming".  Now I get it--thank you.
0
 
LVL 26

Accepted Solution

by:
Rejojohny earned 2000 total points
ID: 13598765
>>The reason I need to convert to ASP.net radios is because I need to preserve my viewstate if an error occurs
u could still manage it with the HTML controls .. u just have to add the runat=server to these HTML radio buttons ...
0
Technology Partners: 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!

 
LVL 9

Author Comment

by:stengelj
ID: 13600743
Like this?

<input type="radio" id="myRadio" name="myRadio" runat="server" value="my value">

I didn't think I could do this.  I will try it this morning and report back.
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 13600770
s, thats the way !!
0
 
LVL 9

Author Comment

by:stengelj
ID: 13602638
Yes, that did work but I had to change the double quotes to single quotes like this:

<input type='radio' id='myRadio' name='myRadio' runat='server' value='my value'>

Unfortunately, it exposed another problem for me in that I was assigning a dynamic identifyer for my ID and I can't do that when I add the "runat='server'".  

Like: <input id="myRadio_<% myID %>" ... >

I guess I'll have to re-evaluate my approach to this.  Unless anyone else has a suggestion for me, Rejojohny has answered my question and I'll close it out soon.

Thank you Rejojohny.
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 13608747
thx for the points .. I would advice you that it would be better to use web controls and HTML controls where approriate .. in ur case, i think a web control is more approriate .. if u have to give a dynamic id to the controls .. think about creating dynamic controls .. but then that has its own set of problems .. like viewstate not been maintained unless the controls are created in the init event of the page etc ..
0
 
LVL 9

Author Comment

by:stengelj
ID: 13608786
You're welcome...you did answer my question and it'll probably help me out with somthing else I'm working on.

I did find some stuff relating to what you're saying but I ended up taking a whole new direction (with parameters-yuck!).  It's quick and dirty but it works for what I need.  I just have a little temporary project that I don't want to invest too much energy into...Thanks again.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 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