Seven strokes winning ASP.NET application development

xiaoxiao2021-03-06  41

As Microsoft .NET is popular, ASP.NET is increasingly accepted by the majority of developers. As a developer of ASP.NET, we not only need to master their bases

The principle of this, more practices, and obtain real development skills from practice. In our actual development, the basic principles often meet the development needs.

Seeking more, we have to accumulate some development skills. This article introduces some practical skills to you, hoping to benefit everyone.

Usage

In general, we are using ./../ This relative path to determine and plan our resources (such as pictures, resource files), but this

Under our deployment application, it may be wrong, and if you contain a picture in .ASCX control, this control is not

The problem will appear when the Aspx file of the two directories in the same level.

~ / image / about.bmp

It is a very good way to start the point in the root of the web application, which makes it better than you ./Image/about.bmp is more

Add flexible and convenient. There is a little bad, this way is dynamically parsing at the ASP.NET runtime, so you may not preview in the IDE design mode.

it.

2. After refreshing and submitting the page, save your page scroll bar

There is often such a situation, we need users to submit a form, but more than 500 in the form, the control or text box is to be filled, that is

The user needs to pull the scroll bar that can be filled in IE, so if the user is visible to 2/3 of the IE range, select a combo box value, very unfortunate

The combo box is the server side, then it means that the page will be submitted once, and when the user sees the refresh page, the page is determined at 3/1

That is to show the most beginning of the page, the user only drags the mouse, then then fill the rest of the 250 controls, very unfortunate, 370

The control is needed to choose?

Use the following method to quickly determine and remember where you are submitted.

Online Old Dog Learns New Tricks also has a similar example Maintain Scroll Position in Any Page Element,

But he used Web Behavior this means you need a .htc file

Private sub retainscrollposition ()

Dim SavescrollPosition AS New StringBuilderdim SetScrollPosition As New StringBuilder

RegisterHiddenField ( "__ SCROLLPOS", "0") saveScrollPosition.Append ( "