The M denotes that the literal value (0) is to be considered a decimal, versus an integer.
Testing for bool just becomes:
return (bool)someValue;
It's breaking because whatever value it is that you are passing into the method is a string, not a decimal and thus can not be converted.
A generally better way of going about this would be to simply pass the whole object you are dealing with to the method and let the method check the appropriate property. That way you also move the property part of the non-compiled code into compiled code:
<asp:panel id="pnlSalePrice" runat="server" visible='<%# CanShowPanel(Container) %>'>
Then you convert "Container" to whatever the whole object is, then query its property:
protected bool CanShowPanel(object myObject){
return ((MyObjectType)myObject).SalePrice != 0M;
}
Then you risk less if you change the properties, because that code will break on compiled if you change SalePrice for example.
-Peter
compiledthoughts.com