Solved

VB.Net Image button

Posted on 2011-09-30
6
467 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
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

790 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