我做在ASP.NET 4.5 Web窗體FriendlyUrls一個簡單的測試,Foo.aspx變爲/美孚/(它的工作原理)。 當我嘗試使用FriendlyUrlSegments的屬性來得到URL到控件的ID我得到這個錯誤:ASP.NET的WebForms FriendlyUrlSegments不包含一個構造函數參數0
public Person GetPerson([FriendlyUrlSegments]int? id)
{
return People.Find(p => p.Id == id);
}
我試圖更新:具有[FriendlyUrlSegments]錯誤
'Microsoft.AspNet.FriendlyUrls.ModelBinding.FriendlyUrlSegmentsAttribute' does not contain a constructor that takes 0 arguments
方法來自NuGet的FriendlyUrls。