naem name

naem name

  • NA
  • 59
  • 6.7k

Difficulties with @htm helpers mvc web application

Mar 3 2017 9:07 AM
Hi all,
 
Earlier on, I wrote a code in c# windows forms.
I made some sort of calculator that takes a numbers from the user and calculates them.
 
In MVC, if we have:
Numbers.cs file in Models folder which has the following content:
{
   public int id {get; set;}
   public int n1 {get; set;} // n1 stands for number 1
   public int n2 {get; set;} // n1 stands for number 1 
  public int result {get; set;} 
 
So, I want to take n1 and n2 values from the user in mvc.
there should be a button to add.
then I have a label (with the name result) on the webpage
and a textbox/form next to it.
 
Upon clicking add, the result should be automatically printed in the textbox/form that is close the the result.
I also want to have the result textbox/form property set to"read only".
 
There are few difficulties that I am facing:
1. I want to change the width of the textbox/form that is associated with @html.EditFor or any other html helper
 
2. I want the result to be automatically appear on the @html.EditorFor/ form/ textbox that is associated with the Result lable.
 
3. I also want the result to be automatically stored in the database based on Numbers.cs file.
 
I know how to achieve that in winforms, but i have no idea how to achieve that in mvc, especially with the presence of html helpers.
 
thank you alot in advance for any help.
 
regards,
 
 
 

Answers (2)