javascript on click event is not working fine on img tag
<p>I am trying to open a link on image click using follwoing code</p>

<pre><code> &lt;img src="AllScripts/SliderImages/images/1Main.png" alt="" title="" onclick="openSliderImage(id);"  onmouseover="this.style.cursor='hand'"  width="800px" height="300px" id="http://www.google.com" /&gt;
</code></pre>

<p>It is working fine but when generating image using c# write code using response.write code it doesn't work and goes on the follwoing link</p>

<pre><code>http://localhost:1234/AllScripts/SliderImages/images/1Main.png
</code></pre>

<p>Follwoing code is used to write html</p>

<pre><code> &lt;% {

                               Response.Write(SlidingImages);
                       }

                    %&gt;
</code></pre>

<p>I know it pick the <code>image src</code> rather then <code>image id</code> on image click but why?
This is the javascript function</p>

<pre><code> function openSliderImage(id) {
            alert(id);
            window.open(id, '_blank');
        }
</code></pre>
