protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { //count = count + 1; string fileNameWithPath = Server.MapPath("~/test/") + e.FileName.ToString(); AjaxFileUpload1.SaveAs(fileNameWithPath); }
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { string guid = Guid.NewGuid().ToString(); UploadSession obj = (UploadSession)Session["upload"]; string filename = Server.MapPath("/Albums/" + obj.Folder + "/" + guid + ".JPG"); AjaxFileUpload1.SaveAs(filename); SqlParameter pID = new SqlParameter("AlbumID", SqlDbType.Int); pID.Value = obj.Id; SqlParameter pUrl = new SqlParameter("ImageUrl", SqlDbType.NVarChar); pUrl.Value = guid + ".jpg"; SqlParameter insertedKey = new SqlParameter("AlbumDetailID", SqlDbType.Int); insertedKey.Direction = ParameterDirection.Output; string NewsID = DataAccessLayer.ExcuteNoneQueryHasOutput("Album_InsertAlbumDetail", "AlbumDetailID", pID, pUrl, insertedKey); }