Returns a fully qualified absolute server Url which includes the protocol, server and port in addition to the server relative Url. It can also force https protocol.

Namespace: MonoSoftware.Web
Assembly: MonoSoftware.Web (in MonoSoftware.Web.dll) Version: 1.0.40.661 (1.0.40.661)

Syntax

C#
public static string ResolveServerUrl(
	this Page page,
	string serverUrl,
	bool forceHttps
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function ResolveServerUrl ( 
	page As Page,
	serverUrl As String,
	forceHttps As Boolean
) As String
Visual C++
public:
[ExtensionAttribute]
static String^ ResolveServerUrl(
	Page^ page, 
	String^ serverUrl, 
	bool forceHttps
)
F#
static member ResolveServerUrl : 
        page : Page * 
        serverUrl : string * 
        forceHttps : bool -> string 

Parameters

page
Type: System.Web.UI..::..Page
serverUrl
Type: System..::..String
Any Url, either App relative or fully qualified
forceHttps
Type: System..::..Boolean
if true forces the url to use https

Return Value

Type: String
A fully qualified absolute server Url

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Page. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

Works like Control.ResolveUrl including support for ~ syntax but returns an absolute URL. This method is useful for generating Urls for AJAX methods.

See Also