Solved

VB.Net Image button

Posted on 2011-09-30
6
484 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
Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

 
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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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