@Html使用

@Html.RadioButton("div3r1",0, Model2.div3r1.Contains("0"))

<input id="div3r1" name="div3r1" type="radio" value="0" />  <!-- 当Model2.div3r1.Contains("0")为false -->
<input checked="checked" id="div3r1" name="div3r1" type="radio" value="0" />

@Html.Encode()


@Html.ActionLink()

通过 MVC,Html.ActionLink() 不连接到视图。它创建控制器操作(controller action)的连接。

@Html.ActionLink("About this Website", "About")
输出html: <a href="/Home/About">About this Website</a>

HTML 表单元素

以下 HTML 帮助器可用于呈现(修改和输出)HTML 表单元素:

BeginForm()

@using (Html.BeginForm("ExcelInSave", "controller", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            <input type="file" name="file" />
            <input type="submit" value="导入" />   

        }

后台参数传入| (HttpPostedFileBase file)

EndForm()


TextArea()


TextBox()


CheckBox()


RadioButton()


ListBox()


DropDownList()


Hidden()


Password()


猜你喜欢

转载自blog.csdn.net/just_lover/article/details/80512081
今日推荐