Solved

ASP.net VB.net Move image on button click

Posted on 2013-10-22
4
575 Views
Last Modified: 2013-10-26
Hi

In an ASP.net web app is it possible to move the position of an image behind a button click?

Thanks
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39591234
...behind a button click
As a postback, or via Javascript? If the former, why would you want to post all the way back to the server just to move the image?
0
 

Author Comment

by:murbro
ID: 39591248
Thanks. What JavaScript would I use?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39591568
If you are able to grab this image tag easily then following example would apply

<html>
<head>
<script type="text/javascript">
function changepic()
{
 document.getElementById("demo").style.top=2000 + "px";  
}
</script>
</head>
<body>

<h1>My First Web Page</h1>
<div>
<img id="demp" src="./omna.jpg"  style="position:absolute; left: 400; top: 100; width: 200;      height: 200;"/>
</div>
<button type="button" onclick="changepic()">change pic</button>
</body>
</html>

Open in new window



If not, provide us more information.
0
 

Author Closing Comment

by:murbro
ID: 39602499
Thanks very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

20 Experts available now in Live!

Get 1:1 Help Now