C# Class Argentini.Halide.H3ClientSide

The H3ClientSide class contains methods and properties for manipulating the client-side markup of a page.
Datei anzeigen Open project: argentini/Halide

Public Methods

Method Description
CookieExists ( System request, string cookieName ) : bool

Determines whther a cookie exists or not.

CookieExists ( string cookieName ) : bool

Determines whther a cookie exists or not.

CreateJsonIdArray ( Page pageObject, Control containerControl, string objectName, JsonObjectMode mode ) : void

Insert a script block which creates a JSON object with an array of client control ID names for all server-side controls. This allows access to the objects using javascript. It is best used in the Page_PreRender block. using Argentini.Halide; ... H3ClientSide.CreateJsonIdArray(MyPanel, "en", H3ClientSide.JsonObjectMode.ByID); Assuming that there is a server-side control on the page, with the ID "Control01", its run-time ID is something cryptic, like "ctl00_Body_Control01". After the code above is executed, however, Javascript code on the page itself can refer to all server-side controls by their server-side ID's, as: var obj = document.getElementById(en.Control01); $(en.Control01).value = "test";

CreateJsonIdArray ( Page page, string objectName, JsonObjectMode mode ) : void

Insert a script block which creates a JSON object with an array of client control ID names for all server-side controls. This allows access to the objects using javascript. It is best used in the Page_PreRender block. using Argentini.Halide; ... H3ClientSide.CreateJsonIdArray(Page, "en", H3ClientSide.JsonObjectMode.ByID); Assuming that there is a server-side control on the page, with the ID "Control01", its run-time ID is something cryptic, like "ctl00_Body_Control01". After the code above is executed, however, Javascript code on the page itself can refer to all server-side controls by their server-side ID's, as: var obj = document.getElementById(en.Control01);

GetCookie ( System request, string cookieName ) : String

Returns a specified cookie from a specified request object.

GetCookie ( string cookieName ) : String

Returns a specified cookie from the current request object.

RemoveCookie ( String cookieName ) : void

Remove a cookie from the client web browser.

RemoveCookie ( String cookieName, String path ) : void

Remove a cookie from the client web browser.

RemoveCookie ( String cookieName, String path, String domain ) : void

Remove a cookie from the client web browser.

SetCookie ( String cookieName, String cookieValue, String path, Int32 days ) : void

Create a cookie on the client web browser.

SetCookie ( String cookieName, String cookieValue, String path, Int32 days, String domain ) : void

Create a cookie on the client web browser.

Private Methods

Method Description
H3ClientSide ( ) : System
en ( Control p, JsonObjectMode mode ) : String

Method Details

CookieExists() public static method

Determines whther a cookie exists or not.
public static CookieExists ( System request, string cookieName ) : bool
request System HttpRequest object.
cookieName string Name of cookie for which to verify its existence.
return bool

CookieExists() public static method

Determines whther a cookie exists or not.
public static CookieExists ( string cookieName ) : bool
cookieName string Name of cookie for which to verify its existence.
return bool

CreateJsonIdArray() public static method

Insert a script block which creates a JSON object with an array of client control ID names for all server-side controls. This allows access to the objects using javascript. It is best used in the Page_PreRender block. using Argentini.Halide; ... H3ClientSide.CreateJsonIdArray(MyPanel, "en", H3ClientSide.JsonObjectMode.ByID); Assuming that there is a server-side control on the page, with the ID "Control01", its run-time ID is something cryptic, like "ctl00_Body_Control01". After the code above is executed, however, Javascript code on the page itself can refer to all server-side controls by their server-side ID's, as: var obj = document.getElementById(en.Control01); $(en.Control01).value = "test";
public static CreateJsonIdArray ( Page pageObject, Control containerControl, string objectName, JsonObjectMode mode ) : void
pageObject System.Web.UI.Page The Page object.
containerControl System.Web.UI.Control The container for which all children should be used.
objectName string Name for the object with the array of names.
mode JsonObjectMode JsonObjectMode enumeration which specifies how page /// objects are to be identified; by ID or CSS class name.
return void

CreateJsonIdArray() public static method

Insert a script block which creates a JSON object with an array of client control ID names for all server-side controls. This allows access to the objects using javascript. It is best used in the Page_PreRender block. using Argentini.Halide; ... H3ClientSide.CreateJsonIdArray(Page, "en", H3ClientSide.JsonObjectMode.ByID); Assuming that there is a server-side control on the page, with the ID "Control01", its run-time ID is something cryptic, like "ctl00_Body_Control01". After the code above is executed, however, Javascript code on the page itself can refer to all server-side controls by their server-side ID's, as: var obj = document.getElementById(en.Control01);
public static CreateJsonIdArray ( Page page, string objectName, JsonObjectMode mode ) : void
page System.Web.UI.Page The Page object.
objectName string Name for the object with the array of names.
mode JsonObjectMode JsonObjectMode enumeration which specifies how page /// objects are to be identified; by ID or CSS class name.
return void

GetCookie() public static method

Returns a specified cookie from a specified request object.
public static GetCookie ( System request, string cookieName ) : String
request System HttpRequest object.
cookieName string Name of cookie to retrieve.
return String

GetCookie() public static method

Returns a specified cookie from the current request object.
public static GetCookie ( string cookieName ) : String
cookieName string Name of cookie to retrieve.
return String

RemoveCookie() public static method

Remove a cookie from the client web browser.
public static RemoveCookie ( String cookieName ) : void
cookieName String Name of the cookie to remove.
return void

RemoveCookie() public static method

Remove a cookie from the client web browser.
public static RemoveCookie ( String cookieName, String path ) : void
cookieName String Name of the cookie to remove.
path String Virtual web path for cookie ownership (e.g. use "/" for the root web site).
return void

RemoveCookie() public static method

Remove a cookie from the client web browser.
public static RemoveCookie ( String cookieName, String path, String domain ) : void
cookieName String Name of the cookie to remove.
path String Virtual web path for cookie ownership (e.g. use "/" for the root web site).
domain String Domain which owns the cookie (e.g. ".mydomain.com") or "" for the current domain.
return void

SetCookie() public static method

Create a cookie on the client web browser.
public static SetCookie ( String cookieName, String cookieValue, String path, Int32 days ) : void
cookieName String Name of the cookie to create.
cookieValue String Cookie string value.
path String Virtual web path for cookie ownership (e.g. use "" for the root domain).
days System.Int32 Number of days until expiration.
return void

SetCookie() public static method

Create a cookie on the client web browser.
public static SetCookie ( String cookieName, String cookieValue, String path, Int32 days, String domain ) : void
cookieName String Name of the cookie to create.
cookieValue String Cookie string value.
path String Virtual web path for cookie ownership (e.g. use "" for the root domain).
days System.Int32 Number of days until expiration.
domain String Domain for this cookie (e.g. use ".mydomain.com" format to save cookie for all subdomains)
return void