UserControl.Server Property
.NET Framework 2.0
Gets the HttpServerUtility object for the current Web request.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
'Declaration Public ReadOnly Property Server As HttpServerUtility 'Usage Dim instance As UserControl Dim value As HttpServerUtility value = instance.Server
/** @property */ public HttpServerUtility get_Server ()
public function get Server () : HttpServerUtility
Not applicable.
Property Value
The HttpServerUtility object associated with the Page that contains the UserControl instance.The following example uses the Server property to write the name of the Web server computer on which the user control is running. The myControl.Response.Write syntax instructs the user control to display the information the control obtains with the myControl.Server.Machinename syntax.
myControl.Response.Write("<br /><b>The server code is running on machine</b> : " + myControl.Server.MachineName) Dim actualServerPath As String = myControl.MapPath(myControl.Request.Path)
myControl.get_Response().Write("<br /><b>The server code is"
+ "running on machine</b> : "
+ myControl.get_Server().get_MachineName());
String actualServerPath =
myControl.MapPath(myControl.get_Request().get_Path());
Community Additions
ADD
Show: