I have some C# code doing some form processing for me. Some forms have a certain control, some don't. If the control exists i need to do some processing on it later.
Of course when i try to process the variable on pages that don't have it i get compiler errors. To get around that someone recommended I use FindControl like below.
Unfortunately now I can't get the value found into the string variable I use to do my later processing.
I'm not a full time programmer and it's not my my area of expertise, but there's gotta to be a way to do what i want.
Expand|Select|Wrap|Line Numbers
- RadioButton rb_test = Page.FindControl("rb_monthly") as RadioButton;
- if (rb_test != null) {
- monthly = (string)rb_test;
- }
Thanks for any and all help!!