Hi guy’s, May be some one could explain that behavior:
I am using CheckBoxList from the latest version of MvcContrib
When my page is loading first time - I am simply return my view
return View(Product.GetProduct(productId)); and all seams to be fine.
All html simple controls populated successfulenter code here
ly, including checkboxlist:
<%= this.CheckBoxList(model => model.Product.Statuses).Options(Model.Statuses, model => model.Id, model => model.Name).ItemFormat("{0}
")%>
So, I have a couple of buttons on this form e.g button “Search” (), I can search by productId and display if anything found. So I am passing productId to my controller and this controller returning view the same way as first time: return View(Product.GetProduct(productId)), by the way I am using the same logic - all the same: the same view, the same controller, the same action… nothing new. But in that case I’ve got error message: String was not recognized as a valid Boolean. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: String was not recognized as a valid Boolean.
Source Error:
Line 268: <labe**strong text**l for="group<%=item.Value%>"><%=item.Text%></label><br />
Line 269: <% } %>--%>
Line 270: <%= this.CheckBoxList(model => model.Product.Statuses).Options(Model.Statuses, model => model.Id, model => model.Name).ItemFormat("{0}<br />")%>
Line 271: </div>
Line 272: </div>
I find out, that when view is loaded first time and after, if all checkboxes unchecked I am clicking search - all going well, but when any of checkboxes checked, I am clicking search – I am getting this error.
Need help Any bright ideas?
enter code here`enter code here`enter code here`