C# 클래스 EnterpriseWebLibrary.NetTools

Contains methods that are useful to web applications.
파일 보기 프로젝트 열기: enduracode/enterprise-web-library 1 사용 예제들

공개 메소드들

메소드 설명
AddJavaScriptEventScript ( this control, string jsEventConstant, string script ) : void

Adds the specified JavaScript to the specified event handler of the specified control. Do not pass null for script. Use JsWritingMethods constants for events. To add an onsubmit event, use ClientScript.RegisterOnSubmitStatement instead. A semicolon will be added to the end of the script.

BuildBasicLink ( string text, string url, bool navigatesInNewWindow ) : string

Returns an anchor tag with the specified parameters. Use this only for status messages that are being built after LoadData. In all other cases, use EwfLink.

CombineUrls ( string one, string two ) : string

Combines the given URLs into a single URL with no trailing slash.

CreateImageFromText ( string text, Font font ) : EwfResponse

Creates an image with the given text and font and returns a response object. Text will be all on one line and will not be wider than 800 pixels or higher than 150 pixels. Do not pass null for text. Passing null for font will result in a generic Sans Serif, 10pt font.

GetCookie ( string name ) : System.Web.HttpCookie
GetRelativeUrlToAscxFromType ( Type type ) : string

Given a type, generates a Url based on the namespace and type. Every level of the namespace up to and including the first one that ends in with the string "site" (case insensitive) is dropped. The type "MyControl" in namespace "one.two.three.MyWebSite.Stuff.MyControls" will return "Stuff/MyControls/MyControl.ascx".

GetTextAsEncodedHtml ( this text, bool returnNonBreakingSpaceIfEmpty = true ) : string

Encodes the given text as HTML, replacing instances of \n with <br/> and optionally replacing the empty string with a non-breaking space.

LinkIsBroken ( string url ) : bool

Gets whether a request for the specified URL returns an HTTP status code other than 200 OK.

Redirect ( string url ) : void

Redirects to the given URL. Throws a ThreadAbortedException. NOTE: Make this internal.

SetInitialDisplay ( this control, bool visible ) : void

Sets the initial visibility of a web control. This can be used in tandem with DisplayLinking.

비공개 메소드들

메소드 설명
ExecuteWithResponse ( string url, Action method, bool disableCertificateValidation = false ) : void
IsWebApp ( ) : bool
ToggleInitialDisplay ( this control ) : void

Sets the initial visibility of the given control to the opposite of what it currently is.

getResponseForAnyStatusCode ( this request ) : HttpWebResponse

Gets a response and prevents exceptions caused by HTTP status codes. From http://stackoverflow.com/a/1366869/35349.

getResponseIfPossible ( this request ) : HttpWebResponse

메소드 상세

AddJavaScriptEventScript() 공개 정적인 메소드

Adds the specified JavaScript to the specified event handler of the specified control. Do not pass null for script. Use JsWritingMethods constants for events. To add an onsubmit event, use ClientScript.RegisterOnSubmitStatement instead. A semicolon will be added to the end of the script.
public static AddJavaScriptEventScript ( this control, string jsEventConstant, string script ) : void
control this
jsEventConstant string
script string
리턴 void

BuildBasicLink() 공개 정적인 메소드

Returns an anchor tag with the specified parameters. Use this only for status messages that are being built after LoadData. In all other cases, use EwfLink.
public static BuildBasicLink ( string text, string url, bool navigatesInNewWindow ) : string
text string
url string
navigatesInNewWindow bool
리턴 string

CombineUrls() 공개 정적인 메소드

Combines the given URLs into a single URL with no trailing slash.
public static CombineUrls ( string one, string two ) : string
one string A URL, not null.
two string A URL, not null.
리턴 string

CreateImageFromText() 공개 정적인 메소드

Creates an image with the given text and font and returns a response object. Text will be all on one line and will not be wider than 800 pixels or higher than 150 pixels. Do not pass null for text. Passing null for font will result in a generic Sans Serif, 10pt font.
public static CreateImageFromText ( string text, Font font ) : EwfResponse
text string
font System.Drawing.Font
리턴 EnterpriseWebLibrary.EnterpriseWebFramework.EwfResponse

GetCookie() 공개 정적인 메소드

public static GetCookie ( string name ) : System.Web.HttpCookie
name string
리턴 System.Web.HttpCookie

GetRelativeUrlToAscxFromType() 공개 정적인 메소드

Given a type, generates a Url based on the namespace and type. Every level of the namespace up to and including the first one that ends in with the string "site" (case insensitive) is dropped. The type "MyControl" in namespace "one.two.three.MyWebSite.Stuff.MyControls" will return "Stuff/MyControls/MyControl.ascx".
public static GetRelativeUrlToAscxFromType ( Type type ) : string
type System.Type
리턴 string

GetTextAsEncodedHtml() 공개 정적인 메소드

Encodes the given text as HTML, replacing instances of \n with <br/> and optionally replacing the empty string with a non-breaking space.
public static GetTextAsEncodedHtml ( this text, bool returnNonBreakingSpaceIfEmpty = true ) : string
text this
returnNonBreakingSpaceIfEmpty bool
리턴 string

LinkIsBroken() 공개 정적인 메소드

Gets whether a request for the specified URL returns an HTTP status code other than 200 OK.
public static LinkIsBroken ( string url ) : bool
url string
리턴 bool

Redirect() 공개 정적인 메소드

Redirects to the given URL. Throws a ThreadAbortedException. NOTE: Make this internal.
public static Redirect ( string url ) : void
url string
리턴 void

SetInitialDisplay() 공개 정적인 메소드

Sets the initial visibility of a web control. This can be used in tandem with DisplayLinking.
public static SetInitialDisplay ( this control, bool visible ) : void
control this
visible bool
리턴 void