Click on Image display image on new window

0
424

You need to add some javascript to your code.

// HTML

 <a target="_blank" href="#" onClick='test(this)'>
 <img alt="" src="<%#"data:Image/png;base64,"+ Convert.ToBase64String((byte[])Eval("ImageData"))  %>"" />
 </a>

// Javascript Code

 function test(element) {
        var newTab = window.open();
        setTimeout(function() {
            newTab.document.body.innerHTML = element.innerHTML;
        }, 500);
        return false;
    }

Demo Fiddle

LEAVE A REPLY

Please enter your comment!
Please enter your name here