Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am new at MVC and learning the MVC ,

i have made the class in the controller and access it when i ADD the View.

it goes good but when i run the view in browser it displays nothing.

My view display nothing it not reach to the controller why ?? please help me

What I have tried:

Here is the Class in the Controller
<pre>public class SignInModel
    {
        public string Username { get; set; }
        public string Password { get; set; }
        public bool RememberMe { get; set; }
        public string PreviousUrl { get; set; }
        public SignInModel()
        {
            this.Username = string.Empty;
            this.Password = string.Empty;
            this.RememberMe = false;
            this.PreviousUrl = string.Empty;
        }
    }

Here is the Controller
[HttpGet]
        public ActionResult FacilitySignin()
        {
            return View();
        }


@model InstaCareDoctorPanel.Controllers.SignInModel
@{
    ViewBag.Title = "Login";

}

Here is the View that is not showing in browser



Posted
Updated 8-Jan-18 1:58am

1 solution

In my opinion the problem its the controller. It reads
[HttpGet]
        public ActionResult FacilitySignin()
        {
            return View();
        }

and it would be:
[HttpGet]
        public ActionResult FacilitySignin(InstaCareDoctorPanel.Controllers.SignInModel model)
        {
            return View(model);
        }


or
[HttpGet]
        public ActionResult FacilitySignin()
        {
            InstaCareDoctorPanel.Controllers.SignInModel model = new InstaCareDoctorPanel.Controllers.SignInModel();
            return View(model);
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900