Jump to content
Software FX Community

Chart Image Inside UpdatePanel Causing Full Post-Back


Recommended Posts

I have created a server control for my app and in that control I'm creating an UpdatePanel and adding controls to it. One of the controls I'm adding is a chart in image format. Everything in the update panel (i.e. check box, listbox, buttons) all cause a partial postback except for the chart. When I click on the chart, it causes a full postback.

The nearest I can figure here is that the ID that the SFX_PostBack() is using doesn't contain the ID of the update panel it has been added to and therefore AJAX assumes a full postback. Since the buttons and such also in the control are <input> controls, they are handled by a different AJAX method than the __doPostBack that gets called by the chart's click.

So, my question is how do I get around this so that the chart click doesn't cause a full postback?




Link to comment
Share on other sites

Attached is a very basic version what I have that is causing the problem. My code is actually pretty extensive, so I tried to weed out all the unecessary parts to reproduce the problem. There is no method to insert data or anything like that. Very stripped down. The "Class2" control can be added to an ASPX page to complete the deal. What you'll notice is that when the page is brought up, the clickable links in the chart are in the form of "javascript:SFX_PostBack(Class2$drillDownChart$FXChart, args)" The problem is that the UniqueID that is created for the chart and put into the SFX_PostBack() method does not contain the update panel ID. As a result, when the __doPostBack() method is called and AJAX intercepts the postback, it doesn't know that the chart is actually located in the update panel.

Hope this helps...




Link to comment
Share on other sites

Setting UserCallBacks to true will certainly do it, however this may not be good for you if you are changing objects other than the chart in your event handler.

I was unable to reproduce the problem with the code you sent me. I tried with my own project adding a chart inside an update panel and the events sent by the chart don't cause a whole page update, they work as expected. So this must be something specific to your application.

Please include a complete ASP.NET Web Project that reproduces the problem. Since you are creating all these controls in code (as opposed as markup) I suspect the error has to do with some control in the hierarchy not being assigned an ID.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...