ASP. Click a button to make the page jump to the specified location on this page(2011-04-19 16:46:51)
reproduced
Recently working on a project.
Use the function described in the title.
Implementation method:
1. Add a JavaScript in aspx:
<script language= "javascript" type= "Text/javascript" >
<!--
function Autoclick ()
{
LNK = document.getelementbyidx_x ("Auto");
Lnk.click ();
}
-
</script>
2. In ASPX, add the following code before the form tag:
<!--the following line to finish positioning the page--
<a id= "Auto" href= "#bookmark" ></a>
3. In the location where you want to jump to, add the following code:
<aname= "Bookmark" ></a>
4. Add the following call to the background code of the button:
Clientscript.registerstartupscript (Clientscript.gettype (), "MyScript", "<script>autoclick (); </script > ");
5. Get it done, try it.
Issue: ASP. Click button to go to the top of the page; result: ASP. Click a button to make the page jump to the specified location on this page