ANKIT SHUKLA

ANKIT SHUKLA

  • 1.7k
  • 96
  • 924

Object reference not set to an instance of an object

Jun 11 2018 2:06 AM
 Thats My cshtml Page
 if i use any Razor Syntex in page with calling : @model myProjectName.Model.LoginModel
 
  1. @model OnevisitAdminWebApplication1.Models.LoginModel  
  2. @{  
  3.     Layout = null;  
  4. }  
  5. <!DOCTYPE html>  
  6. <html>  
  7. <head>  
  8.     <meta name="viewport" content="width=device-width" />  
  9.     <title>Login</title>  
  10.     @Styles.Render("~/Content/css")  
  11.     @Scripts.Render("~/bundles/modernizr")  
  12.   
  13. </head>  
  14. <body>  
  15.     @using (Html.BeginForm())  
  16.     {  
  17.         <div class="container">  
  18.             <div class="row">  
  19.                 <div class="col-md-4 col-md-offset-4">  
  20.                     <br>  
  21.                     <!-- Nav tabs -->  
  22.                     <ul class="nav nav-tabs" role="tablist">  
  23.                      
  24.                         <li>  
  25.                             <a href="#user" role="tab" data-toggle="tab" class="big">Login </a>  
  26.                         </li>  
  27.                     </ul>  
  28.                     <div class="tab-content">  
  29.   
  30.                         <div class="tab-pane fade" id="user">  
  31.                             <br>  
  32.                             <fieldset>  
  33.                                 <div class="form-group">  
  34.                                     <div class="right-inner-addon">  
  35.                                         <i class="glyphicon glyphicon-envelope"></i>  
  36.                                         @Html.TextBox(Model.UserName)  
  37.                                         @*<input class="form-control input-lg" value="UserName" id="UserName" required="" placeholder="Email Address" type="text">*@  
  38.                                     </div>  
  39.                                 </div>  
  40.                                 <div class="form-group">  
  41.                                     <div class="right-inner-addon">  
  42.                                         <i class="glyphicon glyphicon-lock"></i>  
  43.                                         @Html.TextBox(Model.Password)  
  44.                                         @*<input class="form-control input-lg" id="Password" value="Password" required="" placeholder="Password" type="password">*@  
  45.                                     </div>  
  46.                                 </div>  
  47.                             </fieldset>  
  48.                             <br><div class=" text-center">  
  49.                                 @ViewBag.message   
  50.                                  
  51.                                   
  52.                                 <button class="btn btn-success btn-block">LOGIN</button>  
  53.                             </div>  
  54.                         </div>  
  55.                     </div>  
  56.                      
  57.                 </div>  
  58.             </div>  
  59.         </div>  
  60.     }  
  61. </body>  
  62.   
  63. @Scripts.Render("~/bundles/jquery")  
  64. @Scripts.Render("~/bundles/bootstrap")  
  65.   
  66. </html>  
 

Answers (1)