Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 应用程序中显示的图像不会显示_Asp.net_Vb.net - Fatal编程技术网

Asp.net 应用程序中显示的图像不会显示

Asp.net 应用程序中显示的图像不会显示,asp.net,vb.net,Asp.net,Vb.net,我有这个代码ImageHandler Public Class ImageHandler : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpH Dim oBJDB As New DBX Try Dim oSDR As System.Data.SqlClient.SqlDataReader oSDR = oBJD

我有这个代码ImageHandler

Public Class ImageHandler : Implements IHttpHandler
   Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpH
    Dim oBJDB As New DBX
    Try
        Dim oSDR As System.Data.SqlClient.SqlDataReader

 oSDR = oBJDB.CreateSDRFromSQLSelect("SELECT SIGNIMAGE FROM APPUSERDTL WHERE UID =@UID")
        If oSDR.Read() Then
            context.Response.BinaryWrite(CType(oSDR("SIGNIMAGE"), Byte()))
            Dim ImageID As New SqlParameter("@UID", Data.SqlDbType.Int)
             ImageID.Value = context.Request.Cookies("UID").Value
        End If
        oSDR.Close()
        oSDR = Nothing
    Catch ex As Exception
    Finally
        oBJDB.Close()
        oBJDB = Nothing
    End Try

End Sub

Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
    Get
        Return False
    End Get
End Property

End Class
如果使用此选项,应用程序中显示的图像不会显示


请帮助我在.aspx文件中放置图像控件:

 <asp:Image ID="Image1" runat="server" Height="75px"  Width="76px" />

请随时联系,别忘了标记为有助于您的答案

“应用程序中显示的图像不显示”是什么意思?您是如何在web应用程序中使用此处理程序的?如果您在web浏览器中仅打开图像url,会返回什么样的数据?我以不同的形式将其放入ImageView,并从该处理程序中获取一个来自数据库的图像文件,并根据UID登录的用户显示如果使用参数@UID picture未显示,但如果使用“where UID=UID”或其中UID='38',图片看起来像您的context.Request.Cookies(“UID”)没有任何值。如果使用的context.request.querystring(“UID”)相同,则查询只会抛出一个例外。。
      imageId as string=context.Request.Cookies("UID").Value
      Image1.ImageUrl = "~/Profile/ImageHandler.ashx?ImageId= "& imageId