Ok, I've been trying to get this working for a few now and thought enough is enough and leave it to you guys to help. Depending on what I click, true or false, this will cause my table to show or hide accordingly. My issue is, if i cancel(close) out of this while the selected is "true", and come back to this, "true" will still be selected and vice versa for "false". What I want to achieve is, regardless of the selected value, when I close out of this and come back, the selected value should alway be set to "false". Any ideas?
<%
var rblRecurrence = new SelectList(new List<ListItem> {
new ListItem { Text = "Yes", Value="true" },
new ListItem { Text = "No", Value="false" }}, "Value", "Text", "false");
var htmlAttributes = new Dictionary<string, object> {
{ "onclick", "if(eval(this.value)) { $('#tblRecurrence').show('slow'); } else { $('#tblRecurrence').hide('slow'); }" }
};
foreach (var rbl in rblRecurrence)
{
%>
<%=Html.RadioButton("rblRecurrenceVal", rbl.Value, rbl.Selected, htmlAttributes)%>
<label><%=rbl.Text%></label>
<%
}
%>