用FileUpload上传:
获得到:string imgName = this.FileUploadPhoto.FileName.ToString();
if (imgName == null || imgName.Equals(""))
{
Response.Write("");
}else
{
this.FileUploadPhoto.SaveAs(Server.MapPath("~/Admin/fileImage/" + imgName));
string dbasePath = imgName; /拍基/敬贺胡"~\\Admin\\fileImage\亮拦\" + imgName;
cp.cImage = dbasePath;//图片路径
调用插入方法
}
页面imgae: ImageUrl='<%# getImage((Eval("cImage")).ToString()) %>'
public string getImage(string image)
{
return "Admin/fileImage/" + image;
}