Last post Dec 08, 2015 06:16 AM by Fei Han - MSFT
Dec 07, 2015 09:37 PM|nhuebner|LINK
Simple question, I hope. I have a group of ASP.net Radiobuttons which are created within a WizardStep in the page's Pre_Init event. These RadioButtons are styled in a way that they look and behave like buttons using Bootstrap classes. I can select the RadioButton
within the WizardStep and see that it is visibly selected as this "button" is darker than the other choices. An inspection of the RadioButton shows that the "active" class is applied to the selected RadioButton. The problem I am running into is when moving
to another step then back to the previous step with the RadioButtons, the previously selected RadioButton shows no evidence of being selected, as in, does not have the "active" class associated with it. In my testing, the RadioButton itself still is selected
if no CSS is applied. My thoughts are I need to have a check somewhere in my CodeBehind to set the CSS class for the RadioButton to "active" if the RadioButton is selected. Question is, which event should I use to check for the selection and change the CSS
class if I am already doing the majority of my Wizard coding in the Pre_Init?
Dec 08, 2015 12:06 AM|davidrobin|LINK
If you are doing initialisations in the init/Pre_init methods you could check the value in the Form_Load and set the css there. That way you know the initialisation is complete.
Dec 08, 2015 06:16 AM|Fei Han - MSFT|LINK
If you are using ASP.NET Wizard control, you could get selected options of Radio Buttons and set the CSS class for the selected Radio Button in Wizard ActiveStepChanged event.
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
//get the selected radio button from ActiveStep
//and set css class for the selected radio button