With the popularity of Microsoft. NET, ASP. NET is increasingly accepted by developers. As a developer of ASP. NET, we not only need to grasp its basic principles, but also need to practice more and get the true development skills from practice. In our actual development
With the popularity of Microsoft. NET, ASP. NET is increasingly accepted by developers. As a developer of ASP. NET, we not only need to grasp its basic principles, but also need to practice more and get the true development skills from practice. In our actual development, the basic principles often fail to meet the development requirements. we need to accumulate more development skills. This article will introduce some practical skills to you first, hope it will be helpful for everyone's development.
1 .~ Usage
In general, we use applications. /.. /This relative path is used to determine and plan our resources (such as comparison files and resource files). However, this method may cause errors when we plan to use them. if an image is included in The ascx control, and the control is referenced by aspx files in two directories at different levels, the title is displayed.
~ /Image/about.bmp is a very good method, which takes the root directory of the Web application as the starting point, so that it is better than your application. /image/about.bmp is more mobile and convenient. It is not good. this method is resolved dynamically during ASP. NET runtime. Therefore, you may not be able to preview it in IDE design mode.
2. refresh and submit the page, and keep your page rotation status
This is often the case where you need to submit more than 500 forms? The control or text box must be filled in. that is to say, the user needs to pull the IE rotation bar to complete the filling. if the user is visible at 2/3 of the IE category, the value of a combo box is selected, unfortunately, the combo box is a server, which means that the page will be submitted once. when the user sees the refreshed page again, the page determines that the location in 3/1 is displayed at the beginning of the page. the user only needs to drag the mouse and then fill in the remaining 250 controls on the premises. Unfortunately, which of the following controls needs to be selected?
The following method can be used to quickly determine and remember your position before submission.
The Old Dog Learns New Tricks on the Internet also has a similar example Maintain Scroll Position in any Page Element, but it applies Web Behavior, which means you need to apply a. htc file.
Private Sub RetainScrollPosition ()
Dim saveScrollPosition As New StringBuilder
Dim setScrollPosition As New StringBuilder
RegisterHiddenField ('_ SCROLLPOS', '0 ')
SaveScrollPosition. Append ('')
RegisterStartupScript ('savescroll ', saveScrollPosition. ToString ())
If (Page. IsPostBack = True) Then
SetScrollPosition. Append ('')
RegisterStartupScript ('setscroll', setScrollPosition. ToString ())
End If
End Sub
Private Sub Page_Load (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles MyBase. Load
RetainScrollPosition ()
End Sub
3. DataList apply templates of different styles