Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 617
  • Last Modified:

ASP.net VB.net Move image on button click

Hi

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

Thanks
0
Murray Brown
Asked:
Murray Brown
  • 2
1 Solution
 
käµfm³d 👽Commented:
...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
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks. What JavaScript would I use?
0
 
CodeCruiserCommented:
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
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now