ASP.NET <MM:IF

Discussion in 'ASP.NET / ASP.NET Core' started by hiwater, Apr 9, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I'm getting an error (System.FormatException: Input string was not in a correct format) trying to check a currany field for zeros or not. I am using the same type of if statement that I've alway used for text fields. What format should the expression be in for an ACCESS DB currency field? Also, Is there any good only reference material for asp.net? Here is the code example of what I'm doing:
    <MM:If runat="server" Expression='<%# (rsStore.FieldValue("UnitCost", Container) <> "0") %>'>
    <ContentsTemplate> <span class="ProductListItem">Unit Cost:</b></span> <span class="ProductListItem">
    <%# Double.Parse(rsStore.FieldValue("UnitCost", Container)).ToString("C") %> </span></ContentsTemplate>
    </MM:If>
     
  2. The currency datatype does not require quotes when used in expressions. So the correct expression is rsStore.FieldValue("UnitCost", Container) <> 0
     
  3. Thank you Lukas. That worked perfectly.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page