我的观点没有显示任何东西,它什么都没显示,请指导我 [英] My view is not showing any thing, it displays nothing, please guide me

查看:101
本文介绍了我的观点没有显示任何东西,它什么都没显示,请指导我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MVC新手并学习MVC,



i让我们在控制器中上课并在我添加时访问它视图。



它很好但是当我在浏览器中运行视图时它什么也没显示。



我的视图显示没有什么不能达到控制器为什么?请帮帮我



我的尝试:



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



用户名

@ Html.TextBoxFor(x => x.Username,new {id =username,@ class =form-control text-input,Required = true, placeholder =Username})


Username
@Html.TextBoxFor(x => x.Username, new { id = "username", @class = "form-control text-input", Required = true, placeholder = "Username" })









密码

@ Html.TextBoxFor(x => x.Password,new {name =password ,type =password,id =password,@ class =form-control text-input,required =true,placeholder =********})


Password
@Html.TextBoxFor(x => x.Password, new { name = "password", type = "password", id = "password", @class = "form-control text-input", required = "true", placeholder = "********" })

推荐答案

在我看来问题是它的控制器。它读取

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);
        }


这篇关于我的观点没有显示任何东西,它什么都没显示,请指导我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆