asp:button click事件未触发 [英] asp:button click event is not firing

查看:88
本文介绍了asp:button click事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我对asp:Button Click事件有疑问.单击事件不会触发,并且当有人单击asp:Button时,PostBack始终为false.我有两个URL,例如www.example.com/en/pages/home.aspx和www.example.com/home.aspx.

第一个URL触发了按钮单击事件,我通过自定义HTTPModule处理了第二个URL.在模块中,我将"/en/pages"添加到application.Request.Url.PathAndQuery.最后,我

字符串urlToredirecz ="/en/pages" + application.Request.Url.PathAndQuery
this.application.Context.Server.TransferRequest(urlToRedirect);

但是单击页面提交按钮不会触发.我不理解我该如何处理.有人请帮助我.

先感谢您.
Aruna

Hi All,

I have a problem with asp:Button Click event. The click event is not firing and PostBack is always false when someone clicks the asp:Button. I have two URLS such as www.example.com/en/pages/home.aspx and www.example.com/home.aspx.

The button click event is firing for first URL and I handle the second URL via a custom HTTPModule. In the module, I add "/en/pages" to the application.Request.Url.PathAndQuery. And finally I do

string urlToredirecz = "/en/pages"+ application.Request.Url.PathAndQuery
this.application.Context.Server.TransferRequest(urlToRedirect);

But the page submit button click is not firing. I don''t undertand how can I handle this. Anyone please help me.

Thank you in advance.
Aruna

推荐答案



据我所知,您可以将数据发布到另一个页面.

但是您正在尝试将数据与事件一起发布.在我看来,这样做的可能性较小.

您可以按照另一种方式进行操作..

为事件存储一个会话变量.然后在该en/pages/redirectpage.aspx
您可以检查事件的会话变量(如果存在)与按钮单击事件中的事件变量相同.

我希望你能理解我说的话

最好的
Hi,

upto my knowledge you can post data to another page .

But you are trying to post data along with event.In my view it has less possibility to do this.

you can follow another way for this like..

store one session variable for event.And in that en/pages/redirectpage.aspx
you can check for session variable for event if it exists do same as in button click event.

I hope you understood what I said

All the Best


这篇关于asp:button click事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆