Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 ListView 中有指向详细页面视图(不是 MVC)的链接:
http://localhost/mysite/events.aspx?eventID=14
实现路由后,链接的形式为:
http://localhost/mysite/Events/14
在 Events.aspx 代码隐藏中解析/获取 eventID 值的最佳方法是什么?我应该/将如何检查以确保实际传递了一个值?
我想通了,并将问题留给其他人参考:
if (!Page.IsPostBack) { if (Page.RouteData.Values["EventID"] != null) { int eventID = Convert.ToInt32(Page.RouteData.Values["EventID"]); } }