locked
how to make fixed calculations ? RRS feed

  • Question

  • User-361354245 posted

    hello, I wanted to know that, how can I make fixed calculations, for example :

    in a text box I will type 1 (or any other digit) and it will calculate it by my fixed calculation, like

    [1] (fixed calculation) {x5} {+10} = 15

    [2] (fixed calculation) {x5} {+10} = 20

    like this, thanks 

    Wednesday, February 3, 2021 11:49 AM

All replies

  • User753101303 posted

    Hi,

    A forum is not well suited for learning from zero. As you seem to be brand new to ASP.NET and maybe C# I would suggest to give a try at https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&tabs=visual-studio

    Rather than  saving the posted form field to a db you could use its value to compute an output value that you'll show then on the same page.

    One could show something but in general you'll need to study turorials on your own. if blocked then ask for a particular point in a forum but you won't be able to learn everything from a forum.

    A first objective could be to enter a name for example and than appending the "z" letter. Then you can trasnform that to use an integer value and then use this value to output the result of your formula.

    Edit:
    - you have ASP.NET 4. x which the latest versiion ever of 20 year old framework. Unless you need to learn that to maintain existing apps, I would suggest to skip that
    - ASP.NET 3.1 or 5.0 is a cross platform rewrite and likely what yoi should learn if you are just starting

    Wednesday, February 3, 2021 12:47 PM
  • User303363814 posted

    Do you know how to multiply in code? (you use the * operator rather than the 'x' that you have shown)

    Do you know how to add in code? (the + operator that you have shown is correct.

    Maybe your problem is how to assign the result of a calculation to another variable?

    The suggestion to try beginners programming tutorials is probably the best approach.

    Thursday, February 4, 2021 9:25 PM