Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accordion does not fire an ItemCommand event on postback #360

Closed
delta1186 opened this issue Jul 5, 2017 · 1 comment
Closed

Accordion does not fire an ItemCommand event on postback #360

delta1186 opened this issue Jul 5, 2017 · 1 comment
Milestone

Comments

@delta1186
Copy link
Contributor

delta1186 commented Jul 5, 2017

The AJAX Control Toolkit 17.1.1>

I am also using the AjaxControlToolkit.StaticResources nuget package. I get the same result without this package too.

The installation method

  • [ x ] NuGet package

Minimal steps to reproduce the bug

Accordian is loaded on page_load and has a link button in the content area. Using headertemplate and contenttemplate. When you link the button the first time the page works. The postback is fired and the accordian's ItemCommand event is handled. In this method I am rebinding the accordian in order to update the contents of the panels based on the button that was just clicked. Here is where the problem occurs. The panel looks like it updated correctly, but if you click the button again in one of the panes, the ItemCommand event is not handled, however the postback did get triggered. Now if you click the button again the ItemCommand event is handled correctly, but since this will cause the accordian to get databound again you continue to get the same issue.

I did find this old post related to the same issue and the fix supposedly fixed the issue. I looked at the .cs file on github and it does not have the INamingContainer implemented as mentioned in the following post: https://forums.asp.net/p/1152731/1892385.aspx#1892385

Couple of details of my project:
update panel - update panel - multiview - accordian

So the accordian is in a view which is in an updatepanel which is in a parent update panel. I am triggering updates on the update panels, but still have the same result.

.Net Framework 4.6.1

Expected result

The link button should trigger the ItemCommand event on each post back.

Browser(s) used

FF Dev

A site deployment method

  • [ x ] VS development web-server

Example project

The following is a simple example showing this issue. I left out the update panels and multiview to make it as simple as possible. You will need to install packages from nuget since I deleted them to make the project size smaller.

accordian_test.zip

@delta1186
Copy link
Contributor Author

delta1186 commented Jul 5, 2017

I did some additional testing. I cloned the ajaxtoolkit project and added that iNamingContainer value to the Accordion.cs file. Built the solution and then pointed my test project to the ajaxtoolkit.dll and I still got the same results. Then I added iNamingContainer to AccordionPane.cs and now the ItemCommand event is trigger every postback instead of ever other postback. I even nested the accordian in an update panel in my test project and it still worked.

@MikhailTymchukDX MikhailTymchukDX changed the title Accordian dynamic databinding Accordion does not fire an ItemCommand event on postback Sep 11, 2017
@MikhailTymchukDX MikhailTymchukDX added this to the 17.1.2 milestone Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants