Html.BeginForm
用于表单提交
@using (Html.BeginForm("DownLoadPng", "TuPian",new {name="wds",pwd="123"},FormMethod.Post))
{
@Html.AntiForgeryToken();
<input name="browserWidth" type="hidden" id="browserWidth2" value="800"/>
<input name="browserHeight" type="hidden" id="browserHeight2" value="800"/>
<input name="thumbnailWidth" type="hidden" id="thumbnailWidth2" value="500"/>
<input name="thumbnailHeight" type="hidden" id="thumbnailHeight2" value="500"/>
<input type="submit" value="下载图片" />
}
[HttpPost]
[ValidateAntiForgeryToken]
public string DownLoadPng(int browserWidth, int browserHeight, int thumbnailWidth, int thumbnailHeight,string name,string pwd)
{
}
注意:@using (Html.BeginForm("DownLoadPng", "TuPian",FormMethod.Post,new {name="wds",pwd="123"}))
这样写的时候 name和pwd收不到
Html.AntiForgeryToken();相当于随机数