SmartCombo and AJAX Update Panel (or IsPostBack property)

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/5/2009 8:34:49 AM
Gravatar
Total Posts 55

SmartCombo and AJAX Update Panel (or IsPostBack property)

Hello!
I have a question and possibly a problem about using SmartCombo inside ASP.NET AJAX Update Panel.

After initial load, before any partial rendering, all SmartCombos work fine. You can select from all of them, etc. After performing first partial rendering (say, displaying some search results in grid or inserting new item), not single one of them can fetch any data. Button image URL stays the same (image is displayed, not V for image path not found). Judging by the behaviour after first partial rendering it seems that value selected before the rendering stays remembered on the page (for example, some custom search is still performed using previously selected item ID). Attempt to select something new fails, however, and even empty drop-down list does not get displayed.

When using SmartCombo without ASP.NET AJAX Update Panel, everything works fine.

What do I miss?

By the way, I see that inside MP, SmartCombo is only used within ModuleSettings.aspx. I wonder why are its DataUrl and ButtonImageUrl properties set every time page reloads and not inside !IsPostBack?

Described peculiarities using SmartCombo and AJAX happen no matter where I set its DataUrl and ButtonImageUrl properties, be it inside !IsPostBack or outside.

1/5/2009 8:46:01 AM
Gravatar
Total Posts 18439

Re: SmartCombo and AJAX Update Panel (or IsPostBack property)

Hi Slaven,

That doesn't surprise me. SmartCombo is something I hacked together a long time ago (before the existence of MS AJAX) when there was nothing similar available. It was not designed to work with ajax and update panels. Probably there are now easier ways of doing what SmartCombo does. Its not a high priority for me to make this work in UpdatePanels. If you'd like to try and come up with a solution for it please do.

Best,

Joe

1/29/2009 7:34:28 AM
Gravatar
Total Posts 55

Re: SmartCombo and AJAX Update Panel (or IsPostBack property)

Hi!

Almost forgot to answer this...

Well, in the end, I took the ordinary AJAX Autocomplete Extender from AJAX Control Toolkit. Main problem was that its value-text pair returning feature is completely undocumented. Official docs cover only text autocomplete without even hint of value retrieval, but I've found this wonderful article that explains how to retrieve value-text pair.

In short, it's simple and no reprogramming of autocomplete extender is needed, only somewhat different way of making its web service than that described in official docs, and usage of one additional hidden field with simple javascript for setting that field's value.

Note: for validation with ASP.NET custom validator, one would probably rather use ordinary "input text runat=server" HTML control with style="display:none;" than hidden field as in article.

Also noteworthy is that autocomplete's web service I integrated into MP works fine with MP's site settings so it's easy to provide a sort of implicit context key for additional, user profile based filtering of content shown in extender.

So, AJAX Autocomplete Extender makes good and ready-to-use replacement for SmartCombo.

1/30/2009 12:55:42 PM
Gravatar
Total Posts 18439

Re: SmartCombo and AJAX Update Panel (or IsPostBack property)

Nice article! I may swap out the SmartCombo and use that when I get a chance.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.