sagar Bhosale

sagar Bhosale

  • NA
  • 179
  • 176k

string[] path how to stored in Session

Jun 16 2011 8:27 AM
string[] path how to stored in Session

protected void asyncImage_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) {
string[] path;
string filename;
string uId = Membership.GetUser(User.Identity.Name).ProviderUserKey.ToString();
try {
if (asyncImage.HasFile) {
path = asyncImage.PostedFile.FileName.Split(new char[] { '\\' });

filename = uId + "_" + path[path.Length - 1];

asyncImage.SaveAs(Server.MapPath("~/temp/"+filename));

hdnUploadedImage.Value = filename;
Session["uploadedImage"] = filename;

Session["Imagepath"] =path; //it is showing me 92e95d97-0575-42f6-b08b-8c81a72d0b07_System.string[]  insted of 92e95d97-0575-42f6-b08b-8c81a72d0b07_3d-windows-8-wallpaper-ocean--sunset-30--1600-x-1200-jpeg-1280x1024jpg
}
} catch (Exception ex) {
ShowMessageAlert(ex.Message);
} finally {
//nothing to do
uPanelDataEntry.Update();
}
}

Answers (10)