拾遗语句

来源:互联网 发布:关于淘宝店 编辑:程序博客网 时间:2024/06/09 19:27
using System.ComponentModel.DataAnnotations;@{    Layout = "~/Views/Shared/_Layout.cshtml";}@Styles.Render("~/Content/css")@Scripts.Render("~/bundles/modernizr")Html.RenderAction("Footer", "Global");<form action="<%=Url.Action("Process") %>" enctype="multipart/form-data" method="post"><input name="up1" type="file" /> <input type="submit" /></form>public ActionResult Process(HttpPostedFileBase up1)//参数名与name名一致即可{up1.SaveAs(Server.MapPath("~/" + up1.FileName));return Content(up1.FileName);}@RenderSection("scripts", false);@if (Request.IsAuthenticated) {    <text>        你好,@Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "管理" })!        @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {            @Html.AntiForgeryToken()            <a href="javascript:document.getElementById('logoutForm').submit()">注销</a>        }    </text>}@section Scripts {    @Scripts.Render("~/bundles/jqueryval")}@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {    @Html.AntiForgeryToken()    @Html.ValidationSummary(true)                @Html.CheckBoxFor(m => m.RememberMe)                @Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" })@Request.HttpMethod.Equals("POST", StringComparison.OrdinalIgnoreCase)

0 0
原创粉丝点击