- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 Bootstrap 在我的 MVC 4 应用程序中创建登录 View 。它正在工作,但这是我的登录 View :
@using (Html.BeginForm())
{
<link href="~/Content/dist/css/signin.css" rel="stylesheet">
<div class="container">
<form class="form-signin" role="form">
<h2 class="form-signin-heading">Entrar</h2>
<input type="text" id="User" name="UserName" class="form-control" placeholder="Usuário" required />
<input type="password" id="Pass" name="Password" class="form-control" placeholder="Senha" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Entrar</button>
</form>
</div>
}
但 css 的引用是 'link href="~/Content/dist/css/signin.css"rel="stylesheet'
行,但它只有在我删除@Html.BeginForm()
,但是当我创建一个 HttpPost
时我无法触发我的操作。
如何在没有 Html.BeginForm()
的情况下调用我的操作?
最佳答案
我现在可以看到您在 eachother 中使用了两种形式。您应该删除 Bootstrap 并确保 BeginForm 发出正确的形式:
<link href="~/Content/dist/css/signin.css" rel="stylesheet">
<div class="container">
@using (Html.BeginForm("your-action", "your-controller",
FormMethod.Post,
new { @class="form-signin", role = "form} ))
{
<h2 class="form-signin-heading">Entrar</h2>
<input type="text" id="User" name="UserName" class="form-control" placeholder="Usuário" required />
<input type="password" id="Pass" name="Password" class="form-control" placeholder="Senha" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Entrar</button>
}
</div>
关于c# - 替换为 Html.BeginForm(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20693222/
我有一个呈现两个局部 View 的主视图。主视图包含表单中的两个部分 View 。每个部分 View 还包含表单。所有 3 个 View 共享相同的 View 模型。我想要做的是用主视图封装来自所有
我有一个用于编辑内容的 View ,比如订单。订单有可以任意添加的行项目。所以一个主视图和嵌套的局部 View 。 每个部分都应该有一个 ajax 表单,用于调整每个订单项或其他内容的数量。 因此:
以下有效,但如何将其转换为 Ajax 调用? @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnU
令人惊讶的是,在我检查了所有帖子之后,仍然没有明确的解释(在我看来)在什么情况下应该使用主题数据...... 我知道对于 html.beginform,它将执行回发,将数据发布到 Controller
MVC3中的Html.BeginForm()和Ajax.Beginform()有什么区别。我只是想知道在什么情况下可以使用 Html.BeginForm() 以及在什么情况下可以使用 Ajax.Beg
当我将表单的一部分放在局部 View 中时,除局部 View 中的表单元素外,所有表单部分都将获得无障碍语法。 我发现如何“应用”无障碍语法的唯一方法是在局部 View 中启动另一种形式。 看法: @
我在 ASP.NET MVC 5 中工作。我在使用 Ajax.BeginForm 提交表单期间显示加载程序: @using (Ajax.BeginForm("Filter", "Log", new A
我正在使用TinyMCE editor在我网站的管理面板上,所以我用 [AllowHtml] 装饰模型属性(tinymce 的目标),并在 View 中使用 Html.BeginForm() 。当我提
我对 Ajax.BeginForm 有很长时间的问题,现在是通过互联网和 SO 进行搜索,但大多数解决方案包括 jquery.unobtrusive-ajax.min或编辑 web.config允许
目的 我有一个简单的表格,列出了名称(在部分 View 中),其上方有一个包含这些名称的下拉列表。目的是根据下拉列表中选择的名称过滤表。一旦下拉列表中的选定值发生变化,过滤就应该发生,并且应该只再次渲
我有一个 Ajax.BeginForm 调用,它应该返回一个局部 View ,但将页面重新路由到 Action。关于什么是错的任何想法? 这是我要在其上呈现部分 View 的主页上的代码:
我创建了一个名为 B2b 的区域在我的 ASP.NET MVC 应用程序中,我还创建了一个名为 Shopify 的子文件夹在该区域下: 为了注册Shopify子文件夹,我创建了一个 CustomVie
我有这个代码: @using (Html.BeginForm()) { @Html.ValidationSummary(true, "Login
我想有条件地使用 Html.BeginForm。代码中有2个字段如下 @using (Html.BeginForm("Form1Action", "Form1", FormMethod.Post, n
在VS2008中使用MVC项目模板(开箱即用),我注意到以下几点: 这是指定Register.aspx表单的方式。 选择“注册”按钮而不提供任何帐户信息将显示此信息。帐户创建失败。请更正错误,然后重
这个问题已经有答案了: Update div using ajax.beginform inside asp mvc view (1 个回答) 已关闭 7 年前。 我正在尝试执行 AJax 表单发布,
我在尝试使用 ASP.NET MVC3 的 Ajax.BeginForm 方法时遇到了一个奇怪的问题。表单通过正确的操作属性在页面上正确呈现。但是,当提交表单时,“OnFailure”事件返回“Not
有没有办法让 AjaxBeginForms 忽略某些指定的按钮? 例如我的代码是: @using (Ajax.BeginForm("CreatePost", "Accounts", new AjaxO
我读到this我想知道 Ajax.BeginForm 是否已过时 谢谢 最佳答案 嗯,它并没有过时,但达林在你所链接的问题中强烈反对使用它。 就我个人而言,MVC 2 的客户端解决方案在某些方面感觉像
我正在开发一个 ASP.NET MVC 3 应用程序。我想使用 AJAX.BeginForm。有哪些可以详细研究的资源/教程链接? 最佳答案 试试 Unobtrusive Ajax helpers i
我是一名优秀的程序员,十分优秀!