Html.BeginForm()用GET方法 [英] Html.BeginForm() with GET method

查看:149
本文介绍了Html.BeginForm()用GET方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么可以指定自己的状态应该使用GET方法,@ Html.BeginForm()?

How can I specify that my form should be using GET method with @Html.BeginForm() ?

@using (Html.BeginForm(method: FormMethod.Get))

下面VS抱怨最好超负荷不具有参数方法。谢谢!

Here VS complains that best overload doesn't have a parameter method. Thank you!

推荐答案

有一个超载,允许你指定方式:

There is an overload that allows you to specify the method:

@using (Html.BeginForm("someAction", "someController", FormMethod.Get))
{
    ...
}

这篇关于Html.BeginForm()用GET方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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