Learn how to a build a cloud-first strategyRegister Now


Have a textbox display the results of a formula

Posted on 2008-11-10
Medium Priority
Last Modified: 2012-06-21
I have four texboxes as follows, numerator, denominator, and one for Gross Acres. I want the fourth Textbox to display the result of what the user inputs for the fields, the ( (numerator/denominator) * Grossacres), I just wasn't sure how to go about this.
Question by:GravitaZ24

Author Comment

ID: 22924534
I just want the ASFS_NETACTB textbox to display the solution to ((ASFS_FRACT_NTB /ASFS_FRACT_DTB) * ASFS_GROSSACTB). Is that possible?
Fee Simple</td>	
		<asp:textbox id="ASFS_FRACT_NTB" runat="server" Text='<%# Eval("ASFS_FRACT_N") %>' Width="35px" />
		<asp:textbox id="ASFS_FRACT_DTB" runat="server" Text='<%# Eval("ASFS_FRACT_D") %>' Width="35px" />
		<asp:textbox id="ASFS_GROSSACTB" runat="server" Text='<%# Eval("ASFS_GROSSAC") %>' />
		<asp:textbox id="ASFS_NETACTB" runat="server"  Text='<%# Eval("ASFS_NETAC") %>' />
		<asp:textbox id="ASFS_OVERLAPTB" runat="server" Text='<%# Eval("ASFS_OVERLAP") %>' />
		<asp:textbox id="ASFS_TAXPARCELIDTB" runat="server" Text='<%# Eval("ASFS_TAXPARCELID") %>' />

Open in new window


Accepted Solution

amanola earned 1000 total points
ID: 22926327
First add a button to this form, like:
<asp:Button ID="Button1" runat="server" Text="Submit" OnClick="SumClick" />

Then create the OnClick method, like:
    protected void SumClick(object sender, EventArgs e)
        double dSum = ((Convert.ToDouble(ASFS_FRACT_NTB.Text) / Convert.ToDouble(ASFS_FRACT_DTB.Text)) * Convert.ToDouble(ASFS_GROSSACTB.Text));
        ASFS_NETACTB.Text = dSum.ToString();

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

810 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