VirtualPathData.VirtualPath Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the URL that was created from the route definition.
public:
property System::String ^ VirtualPath { System::String ^ get(); void set(System::String ^ value); };
public string VirtualPath { get; set; }
member this.VirtualPath : string with get, set
Public Property VirtualPath As String
Property Value
The URL that was generated from a route.
Examples
The following example shows a control that creates a URL based on a route that has parameters that are named action
and categoryName
.
RouteValueDictionary parameters = new RouteValueDictionary { { "action", "show" }, { "categoryName", "bikes" } };
VirtualPathData vpd = RouteTable.Routes.GetVirtualPath(null, parameters);
HyperLink1.NavigateUrl = vpd.VirtualPath;
Dim vpd As VirtualPathData
Dim parameters As RouteValueDictionary
parameters = New RouteValueDictionary(New With {.action = "show", .categoryName = "bikes"})
vpd = RouteTable.Routes.GetVirtualPath(Nothing, parameters)
HyperLink1.NavigateUrl = vpd.VirtualPath
Remarks
To generate a URL, you call the GetVirtualPath method. That method returns an instance of the VirtualPathData class, which contains information about the route. The VirtualPath property contains the generated URL.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈