Solved

VB.Net Image button

Posted on 2011-09-30
6
480 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:Wildone63
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 36893322
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 :)



0
 
LVL 22

Expert Comment

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

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 36893625
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 16

Expert Comment

by:MikeMCSD
ID: 36899062
Create a new page "imageViewer.aspx". Put this in the .aspx :

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

<script language="javascript" type="text/javascript">
    function closewindow() {
        window.close()
    }
</script>
</head>

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

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

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

</body>

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");}
</script>


<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.
0
 
LVL 16

Expert Comment

by:MikeMCSD
ID: 36899073
you're using VB, so this instead :

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


0
 
LVL 1

Author Closing Comment

by:Wildone63
ID: 36925075
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!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question