private int AddData() { string Title = txtControlTitle.Text; int Type = int.Parse(ddlControlType.SelectedValue); string Key = txtControlKey.Text; string ControlSrc = string.Empty; if (ControlSrc_File.Value != string.Empty) { ControlSrc = GetVirtualPath(ControlSrc_File.Value); } //string Physical_ControlSrc= ControlSrcFile.Value; //string ControlSrc = GetVirtualPath(Physical_ControlSrc.Value); // Uri uriSiteRoot = new Uri(context.Request.Url.GetLeftPart(UriPartial.Authority)); //string ControlSrc = uriSiteRoot + "/" + Physical_ControlSrc; /*** UPLOAD ****************************************************************************************************************************************/ HttpPostedFile file = IconFile.PostedFile; string Icon_FileName = ""; if (file.ContentLength > 0) { Icon_FileName = System.IO.Path.GetFileName(file.FileName); string savePath = Server.MapPath("~/" + System.Configuration.ConfigurationManager.AppSettings["upload_image_dir"] + "/module_images/" + Icon_FileName); file.SaveAs(savePath); } /*******************************************************************************************************************************************/ ModuleController module_control_obj = new ModuleController(); int result = module_control_obj.Insert(_idx, Title, Key, ControlSrc, Type, Icon_FileName); return result; }