Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.90 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is '@model dynamic' valid in an ASP.NET MVC3 .cshtml page?
  2. @model Livestream.LoginModel
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6.     <title>Remote Observation</title>
  7.     <link type="text/css" rel="stylesheet" media="all" href="/Content/CSS/main.css" />
  8. </head>
  9. <body>
  10.     @{
  11.         dynamic dave = "Sign In";
  12.     }
  13.     <div class='normal center'>
  14.         <p><img src='/Content/images/logo.png' /></p>
  15.         @using(Html.BeginForm("Login", "Main")) {
  16.             <div class='loginBox'>
  17.                  <p>Username<br />@Html.TextBoxFor(m => m.Username)</p>
  18.                  <p>Password<br />@Html.PasswordFor(m => m.Password)</p>
  19.                  <p><input type='submit' value='@dave'></p>
  20.             </div>
  21.         }
  22.     </div>
  23.     <script>
  24.         document.getElementById('Username').focus();
  25.     </script>
  26. </body>
  27. </html>
  28.        
  29. @model dynamic
  30.  
  31. @Model.Name
  32.        
  33. @Html.TextBoxFor(m => m.Username)
  34.        
  35. @Html.TextBox("Username")