ASP.Net button click event not firing

旧时模样 提交于 2019-11-30 22:01:39
bstoney

We were have exactly this issue and as you have said it was only happening some of the time and only on pages with Ajax requests. We found that disabling the HTTP Keep-Alive as suggested in the answer to Why does Internet Explorer not send HTTP post body on Ajax call after failure? worked.

This can be done in IIS7 by following the instructions in How to configure HTTP KEEP-ALIVE in IIS 7

i have only used Telerik Ajax controls so far, and my observation is if an exception occours in a Ajax enabled control, nothing happens. No exception report, no action. nothing.

Maybe you should test you app without ajax to identify any problem spots

My initial thought would be that something is happening where the javascript is erroring out (un-caught) and aborting the async postback.

If you can get this to happen in a development environment, you might want to try error handling the window.onerror event and throwing some alert boxes up. It might help to see where possible errors occur.

have you tried:

ScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(yourButton);

It's seem to me, you have issue with Update Panel.

Define the following properties of Update Panel if you are using more than one update panel and updation of one panel change the data of other update panel.

For the UpdatePanel

  1. ChildrenAsTriggers = true
  2. EnableViewState = true (if you are using this feature)
  3. UpdateMode = Always

Use the same properties for other update panel in your same page.

If you find it useful, please mark it as your answer else let me know....

Mohan Sharma

Try commenting out Update panel if any. Then try to click button there must be some error on the page. I've also faced similar issues.

Ramesha KS

In my case none of the events (either button or check box) were firing. I was able to overcome by this problem using following way.

In my master page I had closed a tag referring to an external .js file with /> notation instead of <script></script>.

for Ex: chanage <script src='../../Scripts/common/menu.Js' type='text/javascript' /> to <script src='../../Scripts/common/menu.Js' type='text/javascript' ></script>

Hope this will help you, Ramesh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!