【发布时间】:2011-09-12 06:08:39
【问题描述】:
我有一个使用 Asp.net routing 4.0 的现有 Asp.net 4.0 Web 表单应用程序。现在,我必须向我的 Web 表单应用程序添加一个路由。但我不知道如何将查询字符串访问到我的 aspx 页面。
我所做的是,
routes.MapPageRoute("Products","Products/","~/WebPages/Products.aspx?pid=4",false)
添加那段代码后,我所期望的是, 当我浏览 http:\localhost\mysite\Products 时,我应该被重定向到我的 Products.aspx 页面,在那里我应该能够访问 Request.QueryString["pid"]。 但我无法访问查询字符串。
我怀疑这在 Asp.net 4.0 Routing for Webforms 中是否允许。我怎样才能满足我的要求?
谢谢, M
【问题讨论】:
标签: asp.net routing asp.net-4.0 webforms asp.net-routing