Solved

asp.NET question

Posted on 2013-10-29
2
229 Views
Last Modified: 2013-11-02
I am not very good at asp.net but am learning. I was asked to make a couple of changes on a client's site.

Here is the current code:
    <tr align="center">
        <td><asp:Label ID="_budgetMcfe" runat="server" ></asp:Label></td>
        <td><asp:Label ID="_actualMcfe" runat="server" ></asp:Label></td>
    </tr>    

This displays two numbers in each cell. I want to display 4 numbers, two in each cell separated by " / ". The 2nd number is simply the current value divided by 6.

So, I want _budgetMcfe / _budgetMcfe/6 in the first cell and _actualMcfe / _actualMcfe/6 in the 2nd cell that would look something like this:

   1800 / 300     2400 / 400

I would think this would be very easy but what I thought would be obvious did not work.
0
Comment
Question by:bbaldwin
2 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 39610699
If you have enough UI room in your row cells, please modify code behind (C#) that assign text to your labels as follows:
//I assume these values you want to start with:
int budgetMcfeResults = 1800;
int actualMcfe Results = 2400;
_budgetMcfe.Text = String.Format("{0}/{1}", budgetMcfeResults , budgetMcfeResults / 6);
_actualMcfe.Text = String.Format("{0}/{1}", actualMcfe , actualMcfe / 6);

Open in new window

0
 
LVL 2

Author Closing Comment

by:bbaldwin
ID: 39619014
You gave me enough information to figure out what do to. Thanks!!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now