public void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e) { if (StudentUpload.UploadedFiles.Count > 0) { string strOriginalFileName = e.File.FileName; string strUploadFileName = Request.QueryString["TransID"].ToString() + '_' + CommonFunctions.generateUploadStudentFileName(strOriginalFileName); string path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["StudentUploads"]) + '\\' + strUploadFileName; e.File.SaveAs(path); if (ViewState["UploadFileName"] != null) { DataTable dt1 = (DataTable)ViewState["UploadFileName"]; dt1.Rows.Add(strOriginalFileName, strUploadFileName); ViewState["UploadFileName"] = dt1; } else { DataTable dt = getUploadFiles(); dt.Rows.Add(strOriginalFileName, strUploadFileName); ViewState["UploadFileName"] = dt; } if (ViewState["UploadFileName"] != null) { if (StudentUpload.UploadedFiles.Count == ((DataTable)ViewState["UploadFileName"]).Rows.Count) { trMessage.Visible = true; BEStudent objBEStudent = new BEStudent(); BStudent objBStudent = new BStudent(); objBEStudent.IntTransID = Convert.ToInt64(Request.QueryString["TransID"]); objBEStudent.IntStudentID = Convert.ToInt32(Session[EnumPageSessions.USERID]); objBEStudent.DtResult = (DataTable)ViewState["UploadFileName"]; objBStudent.BSaveStudentUploads(objBEStudent); ViewState["UploadFileName"] = null; if (objBEStudent.DtResult != null && objBEStudent.DtResult.Rows.Count > 0) { if (objBEStudent.DtResult.Rows[0][0].Equals(1)) { if (StudentUpload.UploadedFiles.Count > 1) { lblInfo.Text = Resources.AppMessages.Student_UploadFiles_Success; } else { lblInfo.Text = Resources.AppMessages.Student_UploadFile_Success; } lblInfo.ForeColor = System.Drawing.Color.FromName(Resources.AppConfigurations.Color_Success); ImgInfo.ImageUrl = Resources.AppConfigurations.Image_Success; trrad.Visible = false; trFileTypes.Visible = false; trsaveUpload.Visible = false; } else { lblInfo.Text = Resources.AppMessages.Student_UploadFile_Failed; lblInfo.ForeColor = System.Drawing.Color.FromName(Resources.AppConfigurations.Color_Error); ImgInfo.ImageUrl = Resources.AppConfigurations.Image_Error; trrad.Visible = true; trFileTypes.Visible = true; trsaveUpload.Visible = true; } } gvUploadFiles.Rebind(); } } } }