Hi nalinid93,
Instead of using RadioButton use RadioButtonList and validate the RadioButton selection using OnActiveStepChanged event of Wizard control.
Check this example. Now please take its reference and correct your code.
HTML
<asp:Wizard ID="Wizard1" runat="server" OnActiveStepChanged="OnActiveStepChanged"
OnNextButtonClick="Wizard1_NextButtonClick" OnFinishButtonClick="Wizard1_FinishButtonClick"
DisplaySideBar="false">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" Title="Step 1" runat="server">
<table>
<tr>
<td style="width: 136px; text-align: center; color: #C57808; font-weight: bold;">
Q 01
</td>
<td style="width: 800px; text-align: left; padding-left: 8px; font-weight: bold;
font-size: 18px; color: #C57808;">
What will be the time now
</td>
</tr>
<tr>
<td>
<asp:RadioButtonList ID="rb1" runat="server">
<asp:ListItem Text="Ans1" />
<asp:ListItem Text="Ans2" />
</asp:RadioButtonList>
</td>
</tr>
</table>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" Title="Step 2" runat="server">
<table>
<tr>
<td style="width: 136px; text-align: center; color: #C57808; font-weight: bold;">
Q 02
</td>
<td style="width: 800px; text-align: left; padding-left: 8px; font-weight: bold;
font-size: 18px; color: #C57808;">
How should i complete this
</td>
</tr>
<tr>
<td>
<asp:RadioButtonList ID="rb2" runat="server">
<asp:ListItem Text="Will I" />
<asp:ListItem Text="Do I" />
<asp:ListItem Text="Can i" />
</asp:RadioButtonList>
</td>
</tr>
</table>
</asp:WizardStep>
</WizardSteps>
<HeaderTemplate>
<b>ActiveStepIndex Example</b>
</HeaderTemplate>
</asp:Wizard>
Code
C#
protected void OnActiveStepChanged(object sender, EventArgs e)
{
if (Wizard1.ActiveStepIndex == Wizard1.WizardSteps.IndexOf(this.WizardStep2))
{
if (this.rb1.SelectedIndex == -1)
{
Wizard1.ActiveStepIndex = 0;
}
}
}
protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
}
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{
}
VB.Net
Protected Sub OnActiveStepChanged(ByVal sender As Object, ByVal e As EventArgs)
If Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.WizardStep2) Then
If Me.rb1.SelectedIndex = -1 Then
Wizard1.ActiveStepIndex = 0
End If
End If
End Sub
Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As WizardNavigationEventArgs)
End Sub
Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As WizardNavigationEventArgs)
End Sub
Screenshot
