ASP.Net button click event does not fire

This may be related to this question , but I have a bit more information.

I recently upgraded an ASP.Net application to .NET 3.5 after coding a few new elements with Linq. Now my pages interrupt work with event handlers. I narrowed it down to pages with Ajax on them, and I assume that this is either a ScriptManager or an AjaxControlToolkit registration, which speeds up the problem.

In fact, the very creepy part is that the pages seem to work fine for about 2/3 of the time, and the controls lose their event handlers only 1/3 of the time. I wondered about some type of error and the correct page rendering, but I can not find evidence of this.

+4
source share
7 answers

We had exactly this problem, and, as you said, this only happens for a while and only on the Ajax request pages. We found that turning off HTTP Keep-Alive, as suggested in the answer to Why Internet Explorer does not send the body of an HTTP message after an Ajax call after a failure? have worked.

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

+1
source

I have used Telerik Ajax controls so far, and my observation is that an exception occurs in the Ajax control, nothing happens. No exception report, no action. nothing.

Perhaps you should test the application without ajax to identify any problem points.

0
source

My initial thought was that something happens when javascript throws an error (not caught) and interrupts the asynchronous postback.

If you can make this happen in the development environment, you can try to handle the window.onerror error and throw some warning windows. This may help to see possible errors.

0
source

You tried:

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

0
source

Try commenting on the update panel, if any. Then try to click the button, there should be some error on the page. I also encountered similar problems.

0
source

I think you have a problem with Update Panel.

Define the following properties of the update panel if you use several update panels, and updating one panel changes the data of another update panel.

For UpdatePanel

  • ChildrenAsTriggers = true
  • EnableViewState = true (if you use this function)
  • UpdateMode = Always

Use the same properties for other update panels on the same page.

If you find this helpful, mark it as your answer, let me know ....

0
source

In my case, none of the events (neither the button, nor the flag) fired. I was able to overcome this problem as follows.

On my main page, I closed the tag linking to an external .js file with the designation / "> 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 helps you, Ramesh

0
source

All Articles