Easy .NET (C#) Question About Checkboxes and Radio Buttons - Please HELP!

Oct 24 2006 7:45 AM
Hi,

I'm an extreme newbie, so please be nice.

I'm having issues in getting radio buttons and checkboxes on a form to return the values "Yes" or "No".

So far, the radio buttions are returning "True" or "False", which is a start (but I want it to be "Yes" or "No").

The code for the radio buttons on the "aspx" file is the following:
<td class="Td1">Do you have one central purchasing location?</td>
<td class="Td2" style="width: 230px"><asp:RadioButtonList ID="rblCentralPurchasing" runat="server">
<asp:ListItem Value="Yes">Yes</asp:ListItem>
<asp:ListItem Value="No" Selected>No</asp:ListItem>
</asp:RadioButtonList></td>
<td class="Td3"></td>

And the code for the radio buttons on the "aspx.cs" file is the following:
MMsg.Body += "One Central Purchasing Location?: " + rblCentralPurchasing.Text +  "\r\n";



The checkboxes just plain aren't working. So far they're returning the text that's written after the checkbox whether the checkbox is checked or not.


The code for the checkboxes on the "aspx" file is the following:
<tr>
<td class="Td1" colspan="3">May we send you updates and promotions using e-mail?</td>
</tr>
<tr>
<td class="Td2" colspan="3"><asp:CheckBox runat="server" ID="chkEmail" Text="Yes, please use e-mail to send me information about other offerings." /></td>
</tr>

And the code for the checkboxes on the "aspx.cs" file is the following:
MMsg.Body += "May we send updates and promotions using e-mail?: " + chkEmail.Text +  "\r\n";


Your help will be GREATLY appreciated!!

Thanks,

Blastbum :)

Answers (1)