how to use fileupload control in usercontrol and save the file or image in a folder
-
hi everyone i am using fileupload control in usercontrol but i am not able to save it when i am calling this to any page . plz suggest me . thanks inadvance gaurav
-
hi everyone i am using fileupload control in usercontrol but i am not able to save it when i am calling this to any page . plz suggest me . thanks inadvance gaurav
How you are accessing the control in other pages. Or what problem you are getting? Did you try by creating a public property in the control, That return required information of the fileupload control?
-
How you are accessing the control in other pages. Or what problem you are getting? Did you try by creating a public property in the control, That return required information of the fileupload control?
thanks for the response actually i have fileupload control in a usercontrol for retriveing the name of the file or image i am using property: public string pic { get { return cchildpic.FileName; } } and at code behind this code: if (cchildpic.FileName != "") { cchildpic.PostedFile.SaveAs("C:/Upload1" + cchildpic.FileName); } and after that i am using this usercontrol at page2 by drag and drop the user control . this is the small part of the app. if more require then i will give more explanation about app. thanks...gaurav
-
thanks for the response actually i have fileupload control in a usercontrol for retriveing the name of the file or image i am using property: public string pic { get { return cchildpic.FileName; } } and at code behind this code: if (cchildpic.FileName != "") { cchildpic.PostedFile.SaveAs("C:/Upload1" + cchildpic.FileName); } and after that i am using this usercontrol at page2 by drag and drop the user control . this is the small part of the app. if more require then i will give more explanation about app. thanks...gaurav
HI this problem have been shortedout .now images stored in a folder properly.but i am using session at page 2 to take the name of the picture at page 2 like that; Session["p1"] = ctcchild1.pic; it gives right value at page 2. but at page i am using this: Image1.ImageUrl = "C:\\image" + Session["p1"].ToString(); at this page session value did not give any value . give blank value. plz suggest me . thanks.....gaurav