protected void udtFoto_click(object sender, EventArgs args) { try { Personal_foto o = PersonalCtrl.PersonalFotoUdt(((MstCasc)this.Master).getUsrLoged().Id); if (o != null) { img_photo.ImageUrl = "~/rpt/personal/PERFOTO/" + o.Foto + ".jpg"; } } catch (Exception e) { ((MstCasc)this.Master).setError = e.Message; } }
private string perfoto(HttpContext context) { string response = string.Empty; string option = context.Request["opt"].ToString(); string path = string.Empty; //string email = context.Request["email"].ToString(); //string pass = context.Request["pass"].ToString(); switch (option) { case "add": jsonData = new StreamReader(context.Request.InputStream).ReadToEnd(); Personal_foto o = JsonConvert.DeserializeObject <Personal_foto>(jsonData); path = HttpContext.Current.Server.MapPath("~/rpt/personal/PERFOTO"); response = JsonConvert.SerializeObject(PersonalCtrl.PersonalFotoAdd(o, path)); break; default: break; } return(response); }