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

Source: Internet
Author: User

ASP. Click a button to make the page jump to the specified location on this page(2011-04-19 16:46:51) reproduced
Tags:it

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.