Program Configuration in Community

Source: Internet
Author: User
Tags config configuration settings documentation file upload http post http request parent directory web services
The program uses more than one configuration file, now briefly introduces the next few elements of the heart

1.1 <pages> elements
<pages validaterequest= "false"/>

Identify page-specific configuration settings

ValidateRequest: Instructs ASP.net to check for potentially dangerous data in all content entered from the browser. If true, all input data is compared against a list of potentially dangerous values to perform request validation. If a match occurs, ASP.net throws a HttpRequestValidationException exception.

1.2
<add name= "Communitiesmodule" type= "Aspnet.starterkit.communities.communitiesmodule,aspnet.starterkit.communities"

>

/httpmodules>

Configure the HTTP module within an application.

Httpmodule:httpmodule is an assembly that implements IHttpModule interfaces and handles events. asp.net contains a set of HttpModule modules that can be used by the application. For example, ASP.net provides a sessionstatemodule to provide session-state services to applications. You can create a custom HttpModule to respond to ASP.net events or user events.

The general process for writing HttpModule is:

Implements the IHttpModule interface.

Handles the Init method and registers the required events.

Handle the event.

If you must clean up, you can also implement the Dispose method as needed.

Register the module in Web.config.

Child tags
Description

<add>
Add the HttpModule class to the application.

Note that if you have previously specified the same predicate/path combination (for example, in a Web.config file in the parent directory), the second call to <add> overrides the previous setting.


<add name= "OutputCache"

Type= "System.Web.Caching.OutputCacheModule, system.web,

version=1.0.2800.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a "/>


Property
Description

Name
Provides a friendly name for the module. This allows you to associate an event handler for the module event within the Global.asax file.

Type
Specifies a comma-delimited class/assembly combination of versions, assemblies, and public key tokens. asp.net first searches the application's private \ Bin directory for the assembly DLL, and then searches the system assembly cache for the assembly DLL.



<remove>
Removes the HttpModule class from the application.

<clear>
Removes all HttpModule mappings from the application.


1.3
Configure the ASP.net HTTP runtime settings. This section can be declared at the computer, site, application, and subdirectory levels.

Property
Description

maxRequestLength
Indicates the maximum file upload size supported by asp.net. This restriction can be used to prevent denial of service attacks caused by a user passing a large number of files to the server. The specified size is in kilobytes. The default value is 4096 KB (4 MB).


1.4
<add verb= "*" path= "*.jpg" type= "ASPNET.StarterKit.Communities.ImageHandler, ASPNET.StarterKit.Communities"/>

<add verb= "*" path= "*.jpeg" type= "ASPNET.StarterKit.Communities.ImageHandler, ASPNET.StarterKit.Communities"/>

<add verb= "*" path= "*.gif" type= "ASPNET.StarterKit.Communities.ImageHandler, ASPNET.StarterKit.Communities"/>



<remove verb= "*" path= "*.jpg"/>

<remove verb= "*" path= "*.gif"/>


Maps the incoming request to the appropriate IHttpHandler or IHttpHandlerFactory class, based on the URL and the HTTP predicate specified in the request.

Child tags
Description

<add>
Specifies the predicate/path mapped to the IHttpHandler or IHttpHandlerFactory class.

Property
Description

Verb
The predicate list can be a comma-delimited list of HTTP verbs (such as "Get, put, POST") or a Start script map (for example, wildcard * [asterisk]).

Path
The path attribute can contain a single URL path or a simple wildcard string (for example, *.aspx).

Type
Specifies a comma-delimited class/assembly combination. asp.net first searches the application's private \ Bin directory for the assembly DLL, and then searches the system assembly cache for the assembly DLL.



<remove>
Removes the predicate/path mapped to the IHttpHandler class. The <remove> directive must exactly match the predicate/path combination of the previous <add> directive. The directive does not support wildcard characters.

<clear>
Removes all IHttpHandler mappings that are currently configured or inherited by the specified Web.config file.


1.5 <webServices> elements
<webServices>

<protocols>

<add name= "HttpGet"/>

</protocols>

</webServices>

Controls the settings for XML Web services created using asp.net. --|--<protocols>--|--<add> element

Property
Value
Description

Name

The name of the protocol to add that can be used to decrypt or deserialize XML Web services method calls and associated parameters.


HttpGet
Adds an HTTP get protocol. The method name and parameters are passed in to the query string, which is appended to the request URL after the question mark (?).


HttpPost
Adds an HTTP POST protocol. The method name and parameters pass in the free-form region of the HTTP request.


HttpSoap
Adds an HTTP SOAP protocol.


Documentation
Add a special documentation protocol. When the protocol is enabled and the. asmx page is requested directly, ASP.net runs the Helper page to create a document page that is passed to the requesting client.



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.