/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpload_Click(object sender, EventArgs e) { if (this.fileUpload.HasFile) { DownloadableItem download = DownloadableItem.AddNew(lblItemCode.Text, fileUpload.FileName, fileUpload.PostedFile.ContentType, fileUpload.FileBytes); DisplayDownloadInfo(download); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpload_Click(object sender, EventArgs e) { if (this.fileUpload.HasFile) { try { if (null != cboItemCode.SelectedItem) { DownloadableItem download = DownloadableItem.AddNew(cboItemCode.SelectedItem.Value, fileUpload.FileName, fileUpload.PostedFile.ContentType, fileUpload.FileBytes); DisplayDownloadInfo(download); } } catch (ElectronicDownloadException ex) { lblDownloadIdCaption.Text = ex.Message; } } }