How to enlarge an image by just clicking the listview row?
<p>I'm using asp.net and I need help in modifying my codes in javascript where I used to display and enlarge image after clicking the listviewrow.I have tried using image button in the listview control and it works using the codes below when you click the image button. But, I want to remove the image button from the listview and I just want to click the IDLabel of the listview control to display and enlarge the image which is located in my "Images" root folder.As of now all I've got is an enlarge blank image after clicking the row.Please help me modify my codes to display the image. Thanks...Here's my codes below for your reference.</p>

<p><strong>Javascript:</strong></p>

<pre><code> &lt;script src="scripts/jquery-1.4.3.min.js" type="text/javascript"&gt;&lt;/script&gt;

    &lt;script type="text/javascript" &gt;

                var row;
                var id,fname;

                function Display(rowval)
                {
                       row = $(rowval).parent().parent();
                        row.addClass("highlightRow");

                        var idLabel = rowval.id;
                        var fnameLabel = rowval.id.replace("IDLabel","FilenameLabel");

                        id = $('#' + idLabel).text();
                        fname = $('#' + fnameLabel).text();

                        var img = new Image();
    var bcgDiv = document.getElementById("divBackground");
    var imgDiv = document.getElementById("divImage");
    var imgFull = document.getElementById("imgFull");

    img.onload = function() {

        img.src = "~/Images/" + fname;
        imgFull.src = img.src;
        imgFull.style.display = "block";
         };
    img.src= rowval;

    var width = document.body.clientWidth;
    if (document.body.clientHeight &gt; document.body.scrollHeight)
    {
        bcgDiv.style.height = document.body.clientHeight + "px";
    }
    else
    {
        bcgDiv.style.height = document.body.scrollHeight + "px" ;
    }

    imgDiv.style.left = (width-650)/2 + "px";
    imgDiv.style.top =  "20px";
    bcgDiv.style.width="100%";

    bcgDiv.style.display="block";
    imgDiv.style.display="block";
    //return false;
 }
 function HideDiv()
 {
    var bcgDiv = document.getElementById("divBackground");
   var imgDiv = document.getElementById("divImage");
    var imgFull = document.getElementById("imgFull");
    if (bcgDiv != null)
    {
        bcgDiv.style.display="none";
        imgDiv.style.display="none";
        imgFull.style.display = "none";
    }
 }

    &lt;/script&gt;
</code></pre>

<p><strong>Used to display enlarge image:</strong></p>

<pre><code>&lt;div id="divBackground" class="modal"&gt;
&lt;/div&gt;
&lt;div id="divImage"&gt;
    &lt;table style="height: 100%; width: 100%"&gt;
        &lt;tr&gt;
            &lt;td valign="middle" align="center"&gt;

                &lt;img id="imgFull" alt="" src=""
                 style="display: none;
                height: 500px;width: 590px" /&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td align="center" valign="bottom"&gt;
                &lt;input id="btnClose" type="button"  value="close"
                 onclick="HideDiv()"/&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;/div&gt;
</code></pre>

<p><strong>Asp.Net codes from the Listview item template:</strong></p>

<pre><code>&lt;ItemTemplate&gt;
        &lt;tr style="background-color:#DCDCDC;color: #000000;"&gt;
            &lt;td&gt;
                &lt;asp:Label ID="IDLabel" runat="server" Text='&lt;%# Eval("ID") %&gt;' style = "cursor : pointer " onclick = "return Display(this);" /&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;asp:Label ID="NameLabel" runat="server" Text='&lt;%# Eval("Name") %&gt;' /&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;asp:Label ID="AddressLabel" runat="server" Text='&lt;%# Eval("Address") %&gt;' /&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;asp:Label ID="GenderLabel" runat="server" Text='&lt;%# Eval("Gender") %&gt;' /&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;asp:Label ID="AgeLabel" runat="server" Text='&lt;%# Eval("Age") %&gt;' /&gt;
            &lt;/td&gt;

            &lt;td&gt;
                &lt;asp:Label ID="FilenameLabel" runat="server" Text='&lt;%# Eval("Filename") %&gt;' /&gt;
            &lt;/td&gt;

        &lt;/tr&gt;
    &lt;/ItemTemplate&gt;
</code></pre>

<p>Additional reference: If I used this asp.net codes </p>

<pre><code>&lt;asp:Label ID="IDLabel" runat="server" Text='&lt;%# Eval("ID") %&gt;' style = "cursor : pointer " onclick = "return Display(this.src);" /&gt;
</code></pre>

<p>I will get this runtime error below</p>

<p><em>Microsoft JScript runtime error: 'id' is null or not an object.</em></p>
