The InitializeFromMDPath initializes the AdminSite object from a specified metabase path.
AdminSite.InitializeFromMDPath(MetabasePath)
This method requires a specified metabase path, unlike the Initialize method, which requires a server instance and virtual directory specified separately.
The following example initializes an AdminSite object for the application's metabase path:
Call CurSite.InitializeFromMDPath(Request.ServerVariables("APPL_MD_Path"))
The Request.ServerVariables("APPL_MD_Path")
expression returns the metabase path in the form /LM/W3SVC/1/Clocktower
, where LM
refers to the Local Machine, W3SVC
refers to the Internet Service, 1
is the server instance, and Clocktower
is the root of the Web site. This method works only if the application is created at the virtual directory (not a sub-directory).