0

i want to assaign value to string a according to radio button selection list....for that i used this code but it showing the error... "The name 'grbFiltro' does not exist in the current context"

This is my code...

IEnumerable<RadioButton> buttons = grbFiltro.Controls.OfType<RadioButton>() ;

foreach (var Button in buttons)
{
     if (Button.Checked)
     {
         //Do Somethingrb

     }
 }

what is grbFiltro? i searched in google but no satisfied answer....for me

Taja_100
  • 453
  • 6
  • 15
  • You are saying "This is my code" and still you dont know what "grbFiltro" object is? From where did you get this code? I am sure you have not written it by yourself. – samar Jan 31 '14 at 05:26
  • hm!! ya i got it from net....while running it showing grbFiltro is not in context... – Taja_100 Jan 31 '14 at 05:32
  • You must be having a website name from where you got it right? Please post it here. – samar Jan 31 '14 at 05:34
  • http://stackoverflow.com/questions/14752558/how-to-know-which-radiobutton-is-checked – Taja_100 Jan 31 '14 at 05:41

1 Answers1

0

The question which you have posted is based on winforms and not asp.net, the tag which you have given in your question. In the said question, it is talking about a groupbox (I think) which is not available in asp.net. You can achieve a similar functionality though. Check the following links. What made you copy the code in that link in the first place is what intrigues me though.

http://weblogs.asp.net/kencox/archive/2006/09/14/Creating-a-GroupBox-in-ASP.NET.aspx

GroupBox not in toolbox

Community
  • 1
  • 1
samar
  • 5,021
  • 9
  • 47
  • 71
  • thank u samar....my context is i need to assign value to string according to radio button selecttion....i cant enable single selection mode for radio button...but i got solution i assaign group name for radiio button and my problem solved – Taja_100 Jan 31 '14 at 06:39
  • My suggestion to you is give the complete picture of your problem rather than partial. The comment which you mentioned above should actually be part of the question and still more elaboration will be needed. In that way we will be able to help you out more efficiently and quickly. Happy coding! – samar Jan 31 '14 at 06:44