Tag: ashx

使用ashx Handler显示图像

我的aspx页面中有以下图像 ” 在我的aspx.cs中,为此图像指定了一个图像 protected void uploadimage_Click(object sender, System.EventArgs e) { ImageUtils.uploadImage(Titletxt.Text, FileUpload.FileContent); LargeImage.ImageUrl = “~/AvatarImageFetch.ashx?memberid=” + memberid.ToString(); } 出于某种原因,图像不会显示。 这是我的ashx public void ProcessRequest(HttpContext context) { SqlConnection myConnection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings[“FMMImages”].ConnectionString); myConnection.Open(); string sql = “select largeimage from images_temp where id=@memberid”; SqlCommand cmd = new SqlCommand(sql, myConnection); int param; int.TryParse(context.Request.QueryString[“memberid”], out param); cmd.Parameters.Add(“@memberid”, SqlDbType.Int).Value = param; […]