Displaying image on a separate page
<p>I have a image datatype which on click of a linkbutton needs to be displayed on a seperate page</p>

<pre><code>aspx page
    detail view: 
    &lt;asp:TemplateField HeaderText="Evidence (if any)"&gt;
                  &lt;ItemTemplate&gt;
                    &lt;asp:LinkButton ID="lbEvidence" runat="server"
                     Text='&lt;%# DataBinder.Eval(Container.DataItem, "Evidence").ToString()    == String.Empty ? "None" : DataBinder.Eval(Container.DataItem, "Evidence")%&gt;'
                            CommandName="Select" CommandArgument = '&lt;%# DataBinder.Eval(Container.DataItem, "Complaint_Id") %&gt;'&gt; &lt;/asp:LinkButton&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
</code></pre>

<p>ImageHandler.ashx</p>

<pre><code>    &lt;%@ WebHandler Language="C#" Class="FMMadminModule.imageHandler" %&gt;

using System;
using System.Web;
using System.Data;
using System.Web.SessionState;

    namespace FMMadminModule
    {
    public class imageHandler : IHttpHandler, IReadOnlySessionState
    {
    DataTable dt;
    int key;
    byte[] imageOut;
    public void ProcessRequest(HttpContext context)
    {            
        HttpResponse response = context.Response;
        HttpRequest request = context.Request;
        context.Response.ContentType = "image/jpeg";
        response.BufferOutput = false;
        // get the key, the index into the DataTable
        key = Convert.ToInt32(request.QueryString["Complaint_ID"]);           
        // Prepare the datatable to hold the SNo key and the jpeg image, which will be written out 
        dt = new DataTable();
        dt = (DataTable)context.Session["dt"];
        if (!dt.Rows[key]["Evidence"].Equals(null))
        {
            imageOut = (byte[])dt.Rows[key]["Evidence"];
            response.OutputStream.Write(imageOut, 0, imageOut.Length);
        }
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}
}
</code></pre>

<p>How would I display the image on a separate page?
This is how aspx.cs  looks like</p>

<pre><code> protected void dvResolveComplaint_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        if (e.CommandName == "Select")
        {
            DetailsViewRow row = dvResolveComplaint.Rows[5];
            //String RowId = (e.NewSelectedIndex).ToString(); 
            Type csType = this.GetType();
            String strScript = "&lt;script&gt; ";
            strScript += @"var newWindow = window.open('imageHandler.ashx?Complaint_ID=" + e.CommandArgument + @"', 'Evidence', ' height=450, center:yes, width=600, status=no, resizable= yes, menubar=no, toolbar=no, location=yes, scrollbars=no, status=no')";
            strScript += "&lt;/script&gt;";
            ClientScript.RegisterClientScriptBlock(csType, "ViewEvidence", strScript);
            dvResolveComplaint.Attributes.Add("OnClick", strScript);
        }
    }
</code></pre>
