VB.Net Image button

I have an aspx page with an image button
I set the image property of the image button to a small version of a picture.\

When someone clicks this button I want to display the full sized image in a new window.

Can someone please show me how to do this.

Thank You
Who is Participating?
simplier way to do this is to take the original image lets say its 150 X 150
and make a copy of it
and resize it to the small version
so image1.job is 75 X 75
and onclick you display.true the original image 150 X 150

easy as pie :)

or do whats above with onmousover so the user doest even need to click the image :)

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Create a new page "imageViewer.aspx". Put this in the .aspx :

<head runat="server"><title></title>

<script language="javascript" type="text/javascript">
    function closewindow() {

<form id="form1" runat="server">
<table width="100%">
<td align="center">

<asp:Image runat="server" id="imgName" />

<td align="center"><br />
<input type="button" value="Close Window" onclick="closewindow()" />


This in the code-behind :

 protected void Page_Load(object sender, EventArgs e)
            imgName.ImageUrl = Request.QueryString["path"];


Put this in your .aspx page that has the button :

<script language="JavaScript">
function oWin(iPath)
{newWin = window.open("imageViewer.aspx?path=" + iPath,"winOne","height=630,width=680,status=yes,toolbar=no,menubar=no,location=no,top=90,left=120,resizable=yes,scrollbars=yes");}

<asp:ImageButton ID="ImageButton1" ImageUrl="~/images/0000266_0.jpg"  runat="server"
 OnClientClick="oWin('~/images/0000266_0.jpg')"  />

You can adjust the size of the page and location by changing the parameters in the oWin function.
you're using VB, so this instead :

protected void Page_Load(object sender, EventArgs e)
           imgName.ImageUrl = Request.QueryString("path")  

Wildone63Author Commented:
All of the answers were good.

I chose this one because it was very easy to use and had some additional benefits.

I had to purchase the java but it was 29.00. Very good deal!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.