要用FileUpload控件上传图片,然后保存至服务器upload/images 文件夹!下面是保存路径的后台代码:
 /// <summary>
        /// 上传图片
        /// </summary>
        /// <param name="obj">FileUpload控件对象</param>
        /// <param name="Path">文件存放目录</param>
        /// <returns>返回上传的文件名,为空表示失败</returns>
 public string BasePublicUpLoadImage(FileUpload obj, string Path)
        {
            #region
            string uploadName = obj.FileName;
            string pictureName = "";
            if (!string.IsNullOrEmpty(obj.FileName))
            {                int idx = uploadName.LastIndexOf(".");
                string suffix = uploadName.Substring(idx).ToLower();
                //判断文件类型
                if (suffix == ".gif" || suffix == ".jpg" || suffix == ".png")
                {
                    pictureName = System.Guid.NewGuid().ToString() + suffix;
                    //随机产生图片名
                    try
                    {
                        if (uploadName != "")
                        {
                            string path = Server.MapPath(Path);
                            obj.SaveAs(path + pictureName);
                            return pictureName;
                        }
                    }然后就是用 Image控件显示图片
 public static string BasePhotoPath = System.Configuration.ConfigurationManager.AppSettings["PhotoPath"].ToString();imgPhotoPreview.ImageUrl = BasePhotoPath + model.Photo;
在IE8 中就是显示不了图片!求助大神们,请指出BUG 所在,如有实际案例代码的请展示!!!不甚感激asp.netimagepath