0

I'm fairly new to C#. I’ve recently embarked on a web project using asp.net Visual Web Developer. I'm having some issues with the commands for running calculations on a number of web forms.

Some of the web form consist 10 or more numerical fields.

Each form has a Total field.

There are fields that will need to be cross reference different tables to get the correct figure.

For example:

Table A Table B Table C Table D
--------------------------------------------------
Field A1 Field B1 Field C1 Field A1
Field A2 Field B2 Field C2 Field B2
Field A3 Field B3 Field C3 Field C3
--------------------------------------------------
Total A Total B Total C Total D

If someone could help me out on this one, I would be truly grateful

4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by peter_budo
0

Do you mean you have the various tables on different pages? If so you will want to look at storing the variables in some way. Session state, a database or query strings could all work depending on the number of variables you need to carry across to other pages.
One table on one particular page can't directly access what was filled out on an earlier page.
I may have misunderstood your situation though...

Hericles

0

welcome phillon,
Show us your code work please. You may use datatype.Parse method or Convert class method to convert string values into numeric values.

0

Sorry about that post, what is should read is each "Form" not "Table".

The web forms are on different pages. In the Example below each form has three fields. I need to be able to calculate the total value of each form. Form D refers to fields in the same solution, which needs to be calculated together.

Form A Form B Form C Form D
--------------------------------------------------
Field A1 Field B1 Field C1 Field A1
Field A2 Field B2 Field C2 Field B2
Field A3 Field B3 Field C3 Field C3
--------------------------------------------------
Total A Total B Total C Total D

I've attached the code in the affordabilty.aspx.cs file ( in the example, this would be Form D).
You will notice that there are various fields listed.
The main fields from this form that will come from other pages are fields that have Gross or Net Income (Form A), and any fields that have "outgoing" will also come from a different form (Form B).

What I'm looking for is a solution on how to call data from different web form that has been stored in a database (to repopulate a field that maybe set read only); also how to calculate the values entered in a web form to get a sum to be populated in a field called Total.

0

Closing down as there is double in C# section. In the future please post only in forum section which is most related to the issue you having.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.