Easy read on WPF / Silverlight leak management http://www.simple-talk.com/content/article.aspx?article=1337
Simple MVC3/Razor Fileupload and Storage
Recently I had to add a simple fileupload control in an MVC3 Razor page. It wasn't very difficult to do, thanks to System.Web.Helpers and Microsoft.Web.Helpers. To begin... if you don't have Microsoft.Web.Helpers, find and install through NuGet. pm > Install-Package microsoft-web-helpers Next in your Razor view add the following : @using Microsoft.Web.Helpers @{ ViewBag.Title = "Upload Files"; } @using (Html.BeginForm("Upload","Upload", FormMethod.Post, new { @encType = "multipart/form-data" })) { @FileUpload.GetHtml(initialNumberOfFiles:1, allowMoreFilesToBeAdded:true, includeFormTag:false, addText:"Add Files", uploadText: "Upload File") < input type="submit" name="submit" text="upload" /> } Next in your Upload Controller add the following. The submit button on the Razor page submits the form to the Upload
Comments
Post a Comment