Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the practical skills of ASP.NET

Shulou Source: shulou.com Published: 2022-06-02 07:59:25 10月26日 Update

This article mainly explains "what are the practical skills of ASP.NET". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the practical skills of ASP.NET"?

1. Track page execution

Setting breakpoints is a common means in the process of page debugging, in addition, you can also view the tracking information of the page for error troubleshooting and performance optimization. Enabling page tracking in ASP.NET is very convenient, as long as you add the Trace= "True" attribute to the Page instruction:

Tracking information can be divided into two categories:

a. Page execution details

It mainly includes the list of events in the page life cycle, the control tree list (you can view the number of HTML bytes and ViewState bytes of each control), Session status, Application status, Cookie collection, QueryString collection, server variables and other information.

b. Custom tracking information

You can write the specified content to the "Trace Information" section of the trace information by calling the Trace.Write () or Trace.Warn () method in the page code. Even if there is an error on the page, the trace information will still be displayed, and there is no need to delete the relevant trace code when publishing the application, just remove the Trace attribute from the Page directive.

two。 Add client properties to the server-side control

We sometimes add some special properties to the server-side controls, which do not require server-side processing, but simply send them to the client. We might as well call them client-side attributes, such as HTML attributes or custom attributes (which may be used to implement a specific JavaScript function). This can be achieved in the following ways:

a. Add client properties directly to the control

Tags: Controls properties validation pages servers services data clients clients forms buttons information tracking functions locations situations methods users practical skills Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Information Xiaomi MariaDB Redmi