Cerebrus

Progressbar via binding2

Jan 14th, 2010
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 0.53 KB | None | 0 0
  1. <%--
  2. Related to question at:
  3. http://groups.google.com/group/dotnetdevelopment/browse_thread/thread/cf79a9ce4c746b3c
  4. --%>
  5.  
  6. <%--scores are of the form: "0.51", "0.33", "0.85" --%>
  7.  
  8. <asp:Label ID="LabelProgressBar2" runat="server" Style="padding-left: 2px; font-weight: bold;" Height="100%" BackColor="Green"
  9.   Width='<%# Unit.Percentage(Convert.ToDouble(Eval("score")) * 100) %>'
  10.   Text='<%# Bind("score", "{0:00.0000%}") %>'
  11.   ForeColor='<%# Convert.ToDouble(Eval("score")) <= 99.9 ? Color.Red : Color.Black %>' />
  12. </asp:Label>
Advertisement
Add Comment
Please, Sign In to add comment