I am trying to get a .NET method to fire once a radio button is selected or changed. In custom attributes, I added a onselectedindexchanged
with the value being clearBox(“MoreInfo1”). This goal of this particular method is to clear a text box (set to “”).
When I run a test, I get the following error:
CS0149: Method name expected
The line with the error reads:
`<asp:RadioButtonList tooltip=“Approval” onselectedindexchanged=“clearBox("MoreInfo1")” id=“InitialApproval_Decision” runat=“server” cssclass=“FieldValueInputOptions” repeatdirection=“Horizontal” autopostback=“true”>
<asp:ListItem value="YES" text="Yes"></asp:ListItem>
<asp:ListItem value="NO" text="No"></asp:ListItem>
<asp:ListItem value="MORE" text="More Information Needed"></asp:ListItem>
</asp:RadioButtonList>
`The code behind:
protected void clearBox(string MoreInfoID){
if(MoreInfoID == "MoreInfo1"){
InitialApproval_Reason.Text = string.Empty;
}
if(MoreInfoID == "MoreInfo2"){
InitialApproval_Reason.Text = string.Empty;
}
if(MoreInfoID == "MoreInfo3"){
InitialApproval_Reason.Text = string.Empty;
}
}