0

Firstly, I'm pretty sure this is a Framework bug somewhere. Dev - works correctly

UAT - works correctly

Prod - does not work.

I have a list view The model has a bunch of properties. 7 of the properties are decimal 6 are output into text boxes, and 1 into HTML 1 of the text boxes and the HTML output the correct values The other 5 are outputting 0 instead All 7 are referenced as

<%# Eval("Property") %>

If I use

<%# ((MyClass)Container.DataItem).Value %>

I get the correct output/ If I use

<%# Eval("Value", "{0:#,##0}")%>

I get the correct output

Has anyone run across this before? If so, can you point me in the direction of a Hotfix, Bug report, etc from Microsoft about it.

I'm in need of one to clarify to the customer what is going on since the code in question hasn't changed in 18 months, and UAT and Prod are supposed to be on the same versions of everything (but I don't control that). ADDED: Also, just updated my dev box, now at 4.6.1087 and it's still working correctly there.

<asp:ListView ID="lv" runat="server" EnableViewState="False" DataKeyNames="ID" InsertItemPosition="LastItem" OnItemCommand="lv_ItemCommand">
                    <InsertItemTemplate></InsertItemTemplate>
                    <ItemTemplate>
                        <tr><td>
<asp:TextBox runat="server" ID="txtBAF" Text='<%# Eval("BAF")%>' /> SHOWS 0
<asp:TextBox runat="server" ID="txtBAF2" Text='<%# Eval("BAF")%>' /> SHOWS 404.0000 - correct
<%# Eval("BAF")%> SHOWS 404.0000 - correct
<%# Eval("BAF", "#,##0")%> SHOWS 404 - correct
<%: Item.BAF %> SHOWS 404.0000 - correct - if I set the ItemType property for the ListView
<%# ((MyClass)Container.DataItem).BAF %> SHOWS 404.0000 - correct
</td>
</tr>
</ItemTemplate>
</asp:ListView>
Roger Willcocks
  • 1,649
  • 13
  • 27
  • In which way it doesn't work? – Adrian Iftode Feb 12 '17 at 23:25
  • Hmm, either I was confused before, or it's changed again. I can put in a new textbox (copy and paste) and the correct value shows. Putting the value into the HTML using any of the 4 ways shows the correct value, but putting into the specific textbox shows 0 instead, with each of the 4 different ways of doing so. – Roger Willcocks Feb 13 '17 at 09:25
  • Gah. Now I've purged the Temporary ASP.NET files. The problem doesn't exist on 3 lists. On list #4 it's changed again. Now the problem affects only the first two rows in the results. So if Row 5 has a value, and I filter the list to bring row 5 to row 2, the value disappears and is replaced by 0. – Roger Willcocks Feb 13 '17 at 10:14

0 Answers0