protected void cmdFileUpload_Click(object sender, EventArgs e) { if (fuFile.HasFile) { EditFile.DirectFileSave(SecurityContext.CurrentAccount.ID, fuFile, MapPath("~"), WikiSection.Section, ConfigLocation, TenantId, HttpContext.Current); //Do a redirect after post stupid bastard! Response.Redirect(Request.GetUrlRewriter().ToString(), true); } WikiMaster.UpdateNavigationItems(); BindRepeater(); }
protected void cmdFileUpload_Click(object sender, EventArgs e) { if (fuFile.HasFile) { var result = EditFile.DirectFileSave(SecurityContext.CurrentAccount.ID, fuFile, MapPath("~"), WikiSection.Section, ConfigLocation, TenantId, HttpContext.Current); switch (result) { case SaveResult.Ok: Response.Redirect(Request.GetUrlRewriter().ToString(), true); return; case SaveResult.FileEmpty: WikiMaster.PrintInfoMessage(WikiResource.msgFileEmpty, InfoType.Alert); break; case SaveResult.FileSizeExceeded: WikiMaster.PrintInfoMessage(FileSizeComment.GetFileSizeExceptionString(FileUploader.MaxUploadSize), InfoType.Alert); break; } } BindRepeater(); }