我的 UrlRewrite IHttpModule 删除我的第二个 QueryString

发布于 2024-07-25 09:32:15 字数 342 浏览 3 评论 0原文

我有一个自定义的 url 重写器功能,运行良好。 但是,当我要在网址上使用第二个查询字符串时,请删除第二个查询字符串。

我的友好网址:/gallery/view-ablum/?q=1 我的代码: Page.aspx?id=22&q=1 ,当我通过 RewritePath(...) 时,从我的真实页面中删除 &q=1 。 我现在不知道该找谁来解决这个问题,我不知道。

context.RewritePath(ci.PageUrl + ta + "&q=" + q, false);  

IHttpModule 有 IsPostBack 吗?

I have a custom url rewriter function that works fine. But when i are going to use a second querystring on my url, that remove the second querystring.

my friendly url: /gallery/view-ablum/?q=1
i the code: Page.aspx?id=22&q=1 , when i have past RewritePath(...) the remove &q=1 from my real page. I don't now who to fix this, i can't figure it out.

context.RewritePath(ci.PageUrl + ta + "&q=" + q, false);  

Is there a IsPostBack for IHttpModule?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

ˇ宁静的妩媚 2024-08-01 09:32:15

对于问题“IHttpModule 是否有 IsPostBack”

bool isPostBack = !string.IsNullOrEmpty(context.Request.Form["__VIEWSTATE"])

..或者在不使用 viewstate 时引入自己的隐藏字段(无论如何这可能更安全)

for the question, "Is there a IsPostBack for IHttpModule"

bool isPostBack = !string.IsNullOrEmpty(context.Request.Form["__VIEWSTATE"])

..or introduce your own hidden field when not using viewstate (which is probably safer anyway)

情话已封尘 2024-08-01 09:32:15

IHttpModule 有 IsPostBack 吗?

将取决于模块订阅的事件。 较早的 HttpApplication 事件将在 IsPostBack 确定之前发生。

但 IsPostBack 是特定于 WebForm 的(例如,未在 ASP.NET MVC 中使用),在 Page 类之外可能不可用。

Is there a IsPostBack for IHttpModule?

Will depend on which event the module is subscribing to. Earlier HttpApplication events will occur before IsPostBack is determined.

But IsPostBack is WebForm specific (e.g. not used in ASP.NET MVC) is may not be available outside the Page class.

是你 2024-08-01 09:32:15

好吧,我在调试时收到此错误代码: CurrentNotification 'context.CurrentNotification' 引发了类型为 'System.PlatformNotSupportedException' System.Web.RequestNotification {System.PlatformNotSupportedException} 的异常

,我发现了这个

- Base ( "For this operation requires IIS integrated pipeline mode.") System.SystemException (System.PlatformNotSupportedException)

Well i get this error code when i debugg : CurrentNotification 'context.CurrentNotification' threw an exception of type 'System.PlatformNotSupportedException' System.Web.RequestNotification {System.PlatformNotSupportedException}

and i found this

- Base ( "For this operation requires IIS integrated pipeline mode.") System.SystemException (System.PlatformNotSupportedException)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文