Wrox Programmer Forums
BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
This is the forum to discuss the Wrox book Professional ASP.NET 3.5: In C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470187579
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 3rd, 2011, 05:21 AM
Registered User
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default onchenge in the textbox(Post back)

Dear members,
I have encountered this problem for sometime but i have failed to get the solution. I have written my code below in C#.net wanting the Webform to automatically calculate the values from the textboxes as they are entered and displays them at the sametime in the result text box. As the user enters. Please go throu this problem below

================================================== =====
private void Qty_Init(object sender, System.EventArgs e)
this.Qty.AutoPostBack = true;
this.Qty.TextChanged += new System.EventHandler(Qty_TextChanged);
================================================== ========

private void Qty_TextChanged(object sender, System.EventArgs e)
Regex regex = new Regex("^[0-9]*&");
if(regex.IsMatch(this.Qty.Text) && !string.IsNullOrEmpty(this.Qty.Text.Trim()))
double Balance1;
double Amount1 = Convert.ToDouble(this.Qty.Text);
double Amount2 = Convert.ToDouble(this.Unit_Cost.Text);

Balance1 = Amount1 * Amount2;
this.AmountPaid.Text = Convert.ToString(Balance1);
//Balance1 = Convert.ToDouble(this.Balance.Text);


Similar Threads
Thread Thread Starter Forum Replies Last Post
post back SKhna ASP.NET 2.0 Basics 1 March 10th, 2008 09:23 AM
post back k.manisha ASP.NET 1.0 and 1.1 Professional 2 February 7th, 2007 02:28 PM
Why does the form always post back? Conch General .NET 9 January 9th, 2007 04:12 PM
Post Back rngrmn Pro VB.NET 2002/2003 1 May 5th, 2006 11:21 AM
Post Back rngrmn VB.NET 2002/2003 Basics 2 April 6th, 2006 01:14 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.