private void Page_Load(object sender, System.EventArgs e) { // The base page has already created the module, we only have to cast it here to the right type. this._downloadsModule = base.Module as DownloadsModule; this.btnNew.Attributes.Add("onclick", String.Format("document.location.href='EditFile.aspx{0}&FileId=-1'", base.GetBaseQueryString())); if (! this.IsPostBack) { BindFiles(); } }
private void Page_Load(object sender, System.EventArgs e) { this._downloadsModule = this.Module as DownloadsModule; if (! this.IsPostBack) { if (this._downloadsModule.CurrentAction == DownloadsModuleActions.Download && this._downloadsModule.CurrentFileId > 0) { DownloadCurrentFile(); } else { BindFiles(); } } }
private void Page_Load(object sender, System.EventArgs e) { // The base page has already created the module, we only have to cast it here to the right type. this._downloadsModule = base.Module as DownloadsModule; this._fileId = Int32.Parse(Request.QueryString["FileId"]); if (this._fileId > 0) { this._file = this._downloadsModule.GetFileById(this._fileId); if (! this.IsPostBack) { BindFile(); } this.btnDelete.Visible = true; this.btnDelete.Attributes.Add("onclick", "return confirm('Are you sure?');"); } else { // It is possible that a new file is already uploaded and in the database. The // tempFileId parameter in the viewstate should indicate this. if (ViewState["tempFileId"] != null) { int tempFileId = (int)ViewState["tempFileId"]; this._file = this._downloadsModule.GetFileById(tempFileId); } else { // New file. this._file = new File(); // Copy roles that have view rights from parent section. foreach (Permission permission in this._downloadsModule.Section.SectionPermissions) { this._file.AllowedRoles.Add(permission.Role); } this.calDatePublished.SelectedDate = DateTime.Now; } this.btnDelete.Visible = false; } if (! this.IsPostBack) { BindRoles(); } }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); this._module = this._moduleLoader.GetModuleFromSection <DownloadsModule>(CurrentSection); }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); this._module = this._moduleLoader.GetModuleFromSection<DownloadsModule>(CurrentSection); }