Easy Tutorial
❮ Prop Webcontrol Standard Backcolor Control Image ❯

ASP.NET Web Pages - Classes


ASP.NET Class Reference Manual

Method Description
AsBool(), AsBool(true|false) Converts a string value to a Boolean (true/false). Returns false if the string cannot be converted to true/false, or returns the specified value.
AsDateTime(), AsDateTime(value) Converts a string value to a date/time. Returns DateTime. If the string cannot be converted to a date/time, returns MinValue or the specified value.
AsDecimal(), AsDecimal(value) Converts a string value to a decimal value. Returns 0.0 if the string cannot be converted to a decimal value, or returns the specified value.
AsFloat(), AsFloat(value) Converts a string value to a floating-point number. Returns 0.0 if the string cannot be converted to a floating-point number, or returns the specified value.
AsInt(), AsInt(value) Converts a string value to an integer. Returns 0 if the string cannot be converted to an integer, or returns the specified value.
Href(path [, param1 [, param2]]) Creates a browser-compatible URL from a local file path with optional additional path parts.
Html.Raw(value) Renders value as HTML markup instead of HTML-encoded output.
IsBool(), IsDateTime(), IsDecimal(), IsFloat(), IsInt() Returns true if the value can be converted from a string to the specified type.
IsEmpty() Returns true if the object or variable has no value.
IsPost Returns true if the request is a POST. (Initial requests are usually GET.)
Layout Specifies the path of the layout page to be applied to this page.
PageData[key], PageData[index], Page Contains shared data among the current request's page, layout page, and partial pages. You can access the same data using dynamic page properties.
RenderBody() (Layout pages) Renders the content of a content page that is not in any named sections.
RenderPage(path, values) RenderPage(path[, param1 [, param2]]) Renders a content page using the specified path and optional additional data. You can retrieve additional parameters from PageData by position (example 1) or key (example 2).
RenderSection(sectionName [, required = true|false]) (Layout pages) Renders a named content area. Set required to make an area mandatory and not optional.
Request.Cookies[key] Gets or sets the value of an HTTP cookie.
Request.Files[key] Gets the files uploaded in the current request.
Request.Form[key] Retrieves data posted in a form (as a string). Both Request.Form and Request.QueryString require [key] checking.
Request.QueryString[key] Retrieves data specified in the URL query string. Both Request.Form and Request.QueryString require [key] checking.
Request.Unvalidated(key) Request.Unvalidated().QueryString|Form|Cookies|Headers[key] Optionally disables request validation (form elements, query string values, cookies, header values). Request validation is enabled by default to prevent users from submitting markup or other potentially dangerous content.
Response.AddHeader(name, value) Adds an HTTP server response header to the response.
Response.OutputCache(seconds [, sliding] [, varyByParams]) Caches the page output for a specified time. Set sliding to reset the timeout on each page access, and varyByParams to cache different versions of the page for each different query string in the request.
Response.Redirect(path) Redirects the browser request to a new location.
Response.SetStatus(httpStatusCode) Sets the HTTP status code sent to the browser.
Response.WriteBinary(data [, mimetype]) Writes the data content response with an optional MIME type.
Response.WriteFile(file) Writes the file content response.
@section(sectionName) { content } (Layout pages) Defines a named content area.
Server.HtmlDecode(htmlText) Decodes an HTML-encoded string.
Server.HtmlEncode(text) Encodes a string for rendering in HTML markup.
Server.MapPath(virtualPath) Returns the server's physical path for the specified virtual path.
Server.UrlDecode(urlText) Decodes URL text.
Server.UrlEncode(text) Encodes URL text.
Session[key] Gets or sets a value that exists until the user closes the browser.
ToString() Displays the string representation of an object's value.
UrlData[index] Retrieves extra data from the URL (e.g., /MyPage/ExtraData).
❮ Prop Webcontrol Standard Backcolor Control Image ❯