Click here to Skip to main content
15,891,184 members

passing parameter value between methods

Revision 3
i have ajaxfileupload control , i want to insert the image to the database ,
but i want to insert it throw button , not from the upload complete event ,
so i make the button but there isn't filename property !
any help ?
____

C#
protected void fileUploader_UploadComplete(object sender, AjaxFileUploadEventArgs file)
    {
        // User can save file to File System, database or in session state
        if (file.ContentType.Contains("jpg") || file.ContentType.Contains("gif")
            || file.ContentType.Contains("png") || file.ContentType.Contains("jpeg"))
        {
            Session["fileContentType_" + file.FileId] = file.ContentType;
            Session["fileContents_" + file.FileId] = file.GetContents();
        }

        // Set PostedUrl to preview the uploaded file.         
        file.PostedUrl = string.Format("?preview=1&fileId={0}", file.FileId);   
    }


and
C#
protected void btnInsert_Click(object sender, EventArgs e)
    {
         
        //string filePath = "~/_Manage_/upimages/" + file.FileName;
        //fileUploader.SaveAs(filePath);
    }
Posted 28-Dec-12 12:35pm by Ahmad Abd-Elghany.
Tags: , ,