ASP. NET basics 06 _ trivial

Source: Internet
Author: User
Tags xml attribute

 

 

Trivial:

 

Server

 

Server. Execute ("path"); // Execute the processing program in the virtual path in the current context, which can be used to open the aspx File

 

 

 

Navigation controls

SiteMapPath control: Use Web. the sitemap file (or xml can be used) binds url, title, and other attributes. You can set various styles for editing templates. If you do not understand the template, translate the words or search for them, the template style is ever-changing and there is a lot of room for change

TreeView control: You can also use the Web. sitemap file to bind the xml Attribute when editing the properties of the control. Template same as above

 

Master Page Control and attribute acquisition

Master. FindControl ("Master page Control ID"). This code is used in subpages. If attributes are defined on the template page

   {  { Value =

 

Value is the id of the Label control on the template page. You can use Master. MasterValue directly to obtain the Label control on the Master page.

 

Access the nested master page control

This. Master. Master. FindControl ("ContentPlaceHolder1"). FindControl ("Control ID ");

Idea: Find the master from the parent container

 

 

Send a script to the client

This. Page. ClientScript. RegisterStartupScript (this. GetType (), "key", "script text ");

 

 

ADO. NET

Check whether the set contains columns with the specified name.

Table. Columns. Contains ("column name"), used for determining the bool type

 

 

Pseudo-static implementation

Generally, components are used. Here the IHttpHandler interface is used.

 

Create a cs file and enable the class to implement the IHttpHandler interface.

Add the configuration in the <system. web> node

Roughly so

<Add verb = "*" path = "access path such as *. shtml" type = "class name, that is, the class name in the created cs"/>

              Url =         id = Url.Substring(Url.LastIndexOf() + ).Replace(,  +

 


 

    

 

 

 

Simple From verification to restrict access

 

The following is my understanding.

1. Web. config

  

 

 

2. The above

   

 

This section denies all other unauthenticated users from accessing files or webpages in this directory. Use
In this way, the verification function is useless.

After the preceding settings

"Allow"

"Deny"

You can have your own configuration file in each directory to achieve different access permissions (Create web. config in each restricted file ).

                        

 

Write the following configuration

 

For more information about multi-level multi-directory processing on the Internet, see

 

We will discuss the following (path in the location Node

As we mentioned above, each directory can have its own configuration file to achieve different access permissions. When there are many subdirectories, maintenance is more difficult, is there a simple and unified processing method? The answer is, of course, yes. We can

                                                                   

 

Careful people may have discovered
Open
Paste the copied content (the content is
Finally, we know that
<Configuration>
<SessionState cookieless = "true" timeout = "20"/>
</Configuration>
You can solve the problem.

 

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.