Advertisement
Guest User

My20486_03_CalcMVC.Models.Calc1

a guest
Mar 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. @model My20486_03_CalcMVC.Models.Calc1
  2.  
  3. @{
  4.     Layout = null;
  5.     string cssPlus = "", cssMinus = "";
  6.     if(Model.Operation == "+") {
  7.         cssPlus = "pressed";
  8.     }
  9.     if (Model.Operation == "-")
  10.     {
  11.         cssMinus = "pressed";
  12.     }    
  13. }
  14.  
  15. <!DOCTYPE html>
  16.  
  17. <html>
  18. <head>
  19.     <meta name="viewport" content="width=device-width" />
  20.     <title>Index</title>
  21.     <style>
  22.         .pressed {
  23.             background-color:pink;
  24.         }
  25.     </style>
  26. </head>
  27. <body>
  28.     <div>
  29.         <form action="DoCalc" method="post">
  30.             <input type="text" name="x" value="@Model.X" /> <br />
  31.             <input type="text" name="y" value="@Model.Y" /> <br />
  32.             <input type="submit" name="operation" value="+" class="@cssPlus" />
  33.             <input type="submit" name="operation" value="-" class="@cssMinus" /> <br />
  34.             <input type="text" name="z" value="@Model.Z" />
  35.         </form>
  36.     </div>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement