Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

ASP.NET web Pages reference manual


May 12, 2021 ASP.NET


Table of contents


ASP.NET Web Pages - Class

In ASP.NET web Pages class reference manual, we list some of the methods that need to be used, as well as a description of those methods.

ASP.NET reference manual

method describe
AsBool(), AsBool(true|false) The conversion string value is a Boolean value (TRUE / FALSE).If the string cannot be converted to True / false, return false or other specified value.
AsDateTime(), AsDateTime( value ) The conversion string value is a date / time.Return to DateTime.If the string cannot be converted to a date / time, return MINVALUE or other specified value.
AsDecimal(), AsDecimal( value ) The conversion string value is a decimal value.If the string cannot be converted to a decimal value, it returns 0.0 or other specified value.
AsFloat(), AsFloat( value ) The conversion string value is a floating point number.If the string cannot be converted to a floating point number, it returns 0.0 or other specified value.
AsInt(), AsInt( value ) The conversion string value is integer.If the string cannot be converted into an integer, the value of 0 or other specified values is returned.
Href( path [, param1 [, param2]] ) Create a browser-compatible URL from a local file path with an optional additional path portion.
Html.Raw( value ) Renders value Rendered as an HTML tag, rather than being presented as an HTML encoded output.
IsBool(), IsDateTime(), IsDecimal(), IsFloat(), IsInt() Returns true if this value can be converted to a specified type from a string.
IsEmpty() Returns true if the object or variable does not have a value.
IsPost Returns True if the request is POST.(The initial request is usually get.)
Layout The path to the layout page is applied to this page.
PageData[ key ], PageData[ index ], Page In the currently requested page, the layout page, the partial page contains shared data.You can use dynamic pages to access the same data attribute.
RenderBody() (Layout pages) Rendering the content of the content page without the content page of any named area in the layout page, Renders the Content of a Content Page That IS Not in Any Named Sections.
RenderPage( path , values )
RenderPage( path[, param1 [, param2]] )
Rendering the content page that uses the specified path and optional additional data.You can get the value of additional parameters from PageData by Position (Example 1) or Key (Example 2).
RenderSection( sectionName [, required = true|false ] ) (Layout Pages) Rendering a named content area.set up required Let one area are required.
Request.Cookies[ key ] Gets or sets the value of the HTTP cookie.
Request.Files[ key ] Gets uploaded in the current request.
Request.Form[ key ] Get the data of POST in the form (as a string).Request.form and Request.QueryString require [ key ] an examination.
Request.QueryString[ key ] Get the data specified in the URL query string.Request.form and Request.QueryString require [ key ] an examination.
Request.Unvalidated( key )
Request.Unvalidated().QueryString|Form|Cookies|Headers[ key ]
Selectively disable request verification (form elements, query string values, cookie, header).Request verification The default is open to prevent user submission or other potential hazardous content.
Response.AddHeader( name , value ) Add an HTTP server response head in your reply.
Response.OutputCache( seconds [, sliding] [, varyByParams] ) Caches Output Cache at the specified time.set up sliding To reset access timeout time, set up varyByParams Cache different versions of the page for each different query string of the request page.
Response.Redirect( path ) Redirect the browser request to a new location.
Response.SetStatus( httpStatusCode ) Set the HTTP status code to send to the browser.
Response.WriteBinary( data [, mimetype] ) Write data Content response optional MIME type.
Response.WriteFile( file ) Write the file content response.
@section( sectionName ) { content } (Layout page) Defines a named content area.
Server.HtmlDecode( htmlText ) Decodes an HTML encoded string.
Server.HtmlEncode( text ) String coding in HTML tags.
Server.MapPath( virtualPath ) Returns the physical path to the server for the specified virtual path.
Server.UrlDecode( urlText ) Decode the URL text.
Server.UrlEncode( text ) URL text encoding.
Session[ key ] Get or set an existing value until the user turns off the browser.
ToString() Displays the value of an object represented by a string.
UrlData[ index ] Get additional data from the URL (for example, /MyPage/ExtraData )。