Solved

VB.Net Image button

Posted on 2011-09-30
6
441 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now