This topic is locked
[SOLVED]

 Calculate 2 fields - add result into another

5/30/2008 1:20:56 PM
ASPRunner.NET General questions
B
bayganik author

I saw and example of adding a calculated field & re-display of the page in ASP. But, I can not duplicate it in ASP.net . Any ideas?
An example would be to have TotalPrice = Order.QTY * Order.UnitPrice and place the TotalPrice in a text box.

So, if possible, I like to have the events fireup and refresh the page, if there is a TotalPrice calculated.
The title of the article was "adding the field which immediately calculate imposed tax ..."

Eugene 6/2/2008

Build your ASPRunner.NET project

Open tablename_edit.aspx file in editor

Find code:

<asp:TextBox id="fldEditQTY" runat="server" />

and

<asp:TextBox id="fldEditUnitPrice" runat="server" />
Please, change it to:

<asp:TextBox id="fldEditQTY" runat="server" onchange="java script:document.aspnetForm.ctl00_ContentPlaceHolder1_fldEditTotalPrice.value = document.aspnetForm.ctl00_ContentPlaceHolder1_fldEditQTY.value document.aspnetForm.ctl00_ContentPlaceHolder1_fldEditUnitPrice.value" />

and

<asp:TextBox id="fldEditUnitPrice" runat="server" onchange="java script:document.aspnetForm.ctl00_ContentPlaceHolder1_fldEditTotalPrice.value = document.aspnetForm.ctl00_ContentPlaceHolder1_fldEditQTY.value
document.aspnetForm.ctl00_ContentPlaceHolder1_fldEditUnitPrice.value" />

correspondingly