Performing multiplication in web form???

I need to multiply two numbers together on a web form and I have no idea how to do that. Here is the code that I wrote to try to perform this calculation: 

if (txtQuantity.Text != null)
{
lblPrice.Text = intPrice * intQuantity;
}
I'm sure this is simple enough, but I'm new to ASP.NET and C# and not sure how this is supposed to work. Both values are coming from, as you can see, txtQuantity.text and lblPrice.text, both of which are strings. I found a couple of explanations about performing calculations online, but it was clearly written for more advanced users. A code sample would be great!
Take care
0
Ironsmith
1/14/2005 10:13:34 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

3 Replies
537 Views

Similar Articles

[PageSpeed] 41


if (txtQuantity.Text != null)
{
lblPrice.Text = (intPrice * intQuantity).ToString();
}

Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
0
douglas
1/14/2005 10:40:45 PM
How do I put txtQuantity.text and lblPrice.text into the variables. I just tried and I get an "cannot convert string to int" error. 

Take care
0
Ironsmith
1/14/2005 11:28:41 PM

long q=int.Parse(txtQuantity.Text);
long p=int.Parse(txtPrice.Text);

Note that int.Parse() will throw an exception if txtQuantity.Text is, say, "Fred" or "Hi" rather than something that can be parsed as a number.
Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
0
douglas
1/15/2005 2:09:38 AM
Reply:

Similar Artilces:

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Help getting started with a dynamic web form
I'm new to .NET so I was hoping someone could point me in the right direction. I have a form that needs to be dynamically created based on the contents of a XML file. The XML contains data for each 'row' to be created and what type of fields (textbox, custom select box, etc) should be displayed. The number of each type of field will vary from time to time. Using ASP I would have either used XSL to create a form or DOM to walk through the contents of the XML and display/name the proper fields. Using .NET I'm not sure what the proper method is to accomplish my goal. I can use XML c...

How to start coding vb.net(web form and Crystal repotrs)
I use Crystal Report in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (please help me step by step,I try it before but not success) please help me !!! There is sample code and tutorials on my blog entry: http://dotnetjunkies.com/WebLog/richard.dudley/archive/2004/05/03/12692.aspxIf my post is your answer, please mar...

IN VS.Net how can i get a web form to scroll (design mode)
In design mode in VS.Net, there is a scroll bar next to the web form, but it is grayed out.  I can not figure out how to enable it.  I want to design a web form that is larger in size than the surface area shown in teh deisgn window.  Can someone help out with this?Thank you. VS design surface shows how the page is going to be rendered in the browser. Therefore, there is no 'virtual' large size. In the browser scroll bar appears if the browser window is smaller than the page content. You can make scroll bar to appear by enclosing page content in a large container e...

VB .net Web Form will not get contents of Text Box
I have created a web form with text boxes that are bound to a DataSet/DataView.  I have created button to navigate up and down the recordset.  That all works fine. I need to have the ability to edit/add text in any of the boxes and then when clicking "Save" button, it would build an UPDATE query to send to the database. When the Save button is clicked, I have coded to DIM a string var (strSQL) to use to build the SQL command.  For some reason, it will only get the text from a text box if the data was pulled the database.  If I add/edit data, then the SQL command will ha...

How to add multiple web forms to the same web application?
Hello all, I'm a newbie to asp.net as well as visual studio.net. Basically, I want to create only ONE web application to contain all of the "web form" pages of a website, but these pages should be in different subfolders. Now I noticed that, in visual studio.net, I can only add new web forms to the root directory of the web application. (I hope I'm wrong) Now here is my question: how can I add web forms in those subfolders? Many thanks in advance for your response! San first right click your project and add new folder then right click this folder and add new web...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

getting values from a web form to windows form
Hot Requirement ..... Is there any possible of getting values from a web form to windows form ????? Yes One way i to use the WebRequest and WebResponse classes of the System.Net namespace. For example:  WebRequest request = WebRequest.Create("URL of the web page); WebResponse response = request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string content = reader.ReadLine(); ....    Reza Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way fut...

Multiple "Forms" in a Web Form.
Hi, this query relates to ASP.NET 2.0. I use C# but answers in C# or VB.Net is fine. I have a form to capture a person's details. The form is the usual forename, surname, etc. and the Person is held in a Person Class. What I want to be able to do is to move the form creation into a Class in a separate Class in App_Code. This will enable a button to be placed on the web form to "Add Another Person" using the class. This would create a new Person object and write a new form into the page for the second person to fill in their details. Naturally, this could continue to n Pe...

Installed .Net 3.5, now Web App. doesnt work and get Performance Library Errors
Hey guys, Need some help on this one.  Two days ago I had a server admin install .Net 3.5 on my machine and now all .Net apps no longer work on the server.  I need help.  I am in deep water and this is what I have done after realizing this problem.First I received a 404 2 0 Page error which after looked up could mean the ASP.NET frameworks not found. 1. Uninstalled all .Net frameworks.2. Fresh clean install of Frameworks one by one start with 2.0 then jumping to 3.5 both being redistributable packages.3. Restarted IIS, Application pools and still nothing4. Ran aspnet_regi...

.Net Web Form & Web Service Deployment
Hi all I have written some test web services and some web form applications and deployed them to my IIS. That's fine but I now want to deploy them to my real IIS server. I have created an msi for each but the problem is I seem to only be able to deploy to the default web site. Our default web site is turned off and instead we use several other sites. Does anybody happen to if Powerbuilder 11 supports non default web sites? If not do I need to hack the msi and if so can anybody suggest a suitable tool. I have Orca but it's not very friendly. Unless of course I knew exactly w...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

Web resources about - Performing multiplication in web form??? - asp.net.getting-started

Multiplication - Wikipedia, the free encyclopedia
... here. For the typeface, see Times (typeface) . For the UK newspaper, see The Times . For other uses, see The Times (disambiguation) . The multiplication ...

Multiplication - Wikipedia, the free encyclopedia
... here. For the typeface, see Times (typeface) . For the UK newspaper, see The Times . For other uses, see The Times (disambiguation) . The multiplication ...

Operation Math - Addition, Subtraction, Multiplication and Division for Kids on the App Store on iTunes ...
Get Operation Math - Addition, Subtraction, Multiplication and Division for Kids on the App Store. See screenshots and ratings, and read customer ...

Price Drop: Polynomial Multiplication
Polynomial Multiplication 1.0 Device: iOS iPad Only Category: Education Price: Free, Version: 1.0 ( iTunes ) Description: With the Polynomial ...


Priebus: GOP about 'addition and multiplication not division and subtraction'
... with a smile, talk to every American no matter what state you're in and start building a party through the concept of addition and multiplication ...

Exciting Common Core Math Method Adds 28 SECONDS To Basic Multiplication Problems
Exciting Common Core Math Method Adds 28 SECONDS To Basic Multiplication Problems

Accelerating Matrix Multiplication in C++
By inserting a table of column pointers into the calculation of matrices, performance can be significantly enhanced.

A "Simple" Multiplication Game
This simple game will help you rediscover the joy of math.

Breeze Through Grade School With Multiplication Cheat Sheet Socks
... people obviously never managed to score an A+ by looking at someone else's exam. So if you're having a bit of a rough time mastering your multiplication ...

Resources last updated: 12/15/2015 4:33:57 PM