Asp. netpanel

Source: Internet
Author: User

Asp. netpanel

This article is a solution to solve the problem that the panel scroll bar does not automatically return to the top after the asp.net page button clicks the trigger event. After an event is triggered on the page, the panel scroll bar returns to the top again, the following work needs to be pulled down every time. this problem is a headache especially when TreeView is selected. maintainScrollPositionOnPostBack = true.

The principle is to save the position of the panel scroll bar when you click it, and re-assign a value when loading the page after the page trigger event is complete. Make sure that all buttons and other Click events are saved on the page.

Steps:

1. Script

<Head runat = "server"> <title> asp.net page trigger event panel scroll bar height unchanged </title> <link href = "Css/style.css" type = "text/css" rel = "stylesheet"/> <script type = "text/javascript"> function setPanelScroll () {document. getElementById ('denden1 '). value = document. getElementById ('panel1 '). scrollTop ;}</script> 

2. body

Copy codeThe Code is as follows:
<Body onclick = "setPanelScroll ()">

3. assign values

Copy codeThe Code is as follows:
Function ViewObj () {document. getElementById ('panel1'). scrollTop = document. getElementById ('hidden1'). value;} window. onload = ViewObj;


Why can't horizontal scroll bars appear on the aspnet page I wrote ?? Urgent

Because your width is a percentage, you can change it to a fixed px value.
For example:
<Div style = "width: 100%"> </div>
Changed:
<Div style = "width: 990px"> </div>
Reference: www.bjzero.net

Aspnet panel and scroll bar

First, fix the page size, and then set the Attribute overflow to the default value, for example, style = "height: 420px; overflow: auto"

Related Article

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.