MVP RadioButtonList SelectValue invalid -


i have radiobuttonlist 2 listitems. value of 2 list items true , false.

i've boolean value called daily. daily set 'false'

here's code snippet:

 <asp:radiobuttonlist runat="server" id="pfradiobuttonlist" selectedvalue="<%# model.daily.tostring() %>" autopostback="true" onselectedindexchanged="pfradiobuttonlist_onselectedindexchanged">        <asp:listitem text="item 1" value="false"></asp:listitem>        <asp:listitem text="item 2" value="true"></asp:listitem>   </asp:radiobuttonlist> 

the problem on running follwing error: 'pfradiobuttonlist' has selectedvalue invalid because not exist in list of items.

any suggestions please?!

booleans in c# output values capital letters, so

bool f = false; console.write(f.tostring()); 

outputs false, not false. try reflecting in markup:

<asp:listitem text="item 1" value="false"></asp:listitem> <asp:listitem text="item 2" value="true"></asp:listitem> 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -