Small problem solving method in asp.net2.0 development

Source: Internet
Author: User
asp.net| Solve | The problem Small problem solving method in asp.net2.0 development
First, the page is relatively long, if the page is submitted to the server to save the scroll bar location, you can use the following two ways:
1.page.maintainscrollpositiononpostback
When a page is sent back to the server, the user returns to the top of the page. In a longer web page, this means that the user must scroll the page to the previous location on the page.
When the MaintainScrollPositionOnPostBack property is set to True, the user returns to the previous location on the page.
2. Page.smartnavigation
Gets or sets a value that indicates whether smart navigation is enabled. True if smart navigation is enabled, otherwise false.
Note
In most cases, do not set this property in code. Set the SmartNavigation property to True in the @ Page directive of the. aspx file. When the page is requested, the dynamically generated class sets the property.
When a Microsoft Internet Explorer 5.5 or later browser requests a page, smart navigation improves the user's ability to manipulate the page by performing the following functions:
· Eliminates flicker caused by navigation.
· Keep scrolling position when moving from one page to another page.
· Keep the element focus between navigation.
· Only the state of the last page is kept in the browser's history.
Smart navigation is best suited for asp.net pages that require frequent postbacks but that do not change significantly when content returns. Consider this carefully when deciding whether to set this property to True.
The SmartNavigation attribute has been deprecated. Use the SetFocus method and the MaintainScrollPositionOnPostBack property instead.
However, you are prompted on MSDN that the Page.smartnavigation property is now obsolete.
But the above two methods can achieve this kind of requirement, MSDN all said, so still use the first method.
Second, the registration page to refresh the page password box "empty" solution
Oh, we all know the registration page, my registration page In addition to the Password box (TextBox), there is a Drop-down box (autopostback=true), whenever the selection of the Drop-down box will be empty password box, do not know whether Microsoft for the security of its existence elsewhere, Anyway empty and can not get its value, the cost of Dickens (in fact, can be DropDownList through JavaScript to achieve, hehe I want is this effect) finally finished, and ultimately with the help of JavaScript but the operation is the password box.
You only need to add in Page_Load:
TEXTBOX1.ATTRIBUTES.ADD ("value", TextBox1.Text);
TextBox1 is the ID of the password box.


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.