.aspx
<asp:Image ID="Image1" runat="server" ImageUrl="Handler.ashx" />
Handler.ashx
Public Class Handler : Implements IHttpHandler, IRequiresSessionState
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim imageData() As Byte
Dim query As String = "your query"
imageData = "Execute your query"
context.Response.ContentType = "image/jpg"
context.Response.BinaryWrite(imageData)
context.Response.ContentType = "image/jpg"
context.Response.BinaryWrite(imageData)
End Sub
End Class
Note:
you can use a query string to pass information
"Handler.ashx?id="xxx"
Request by
context.Request.QueryString("id")
No comments:
Post a Comment