Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader in a dynamically loaded UserControl Options
UglyDuckling
Posted: Monday, September 3, 2007 8:43:22 AM
Rank: Member
Groups: Member

Joined: 8/29/2007
Posts: 20
I have a UserControl which implements an AJAXUploader. When I test the UserControl on a Page object, it works as expected.

However, I have a page that dynamically loads "widgets" which are UserControls onto a page, and these widgets use ASP.NET AJAX, static html, or EO objects. The surface they are loaded to is an ASP.NET AJAX UpdatePanel because the drag-and-drog interface is implemented in that technology.

If my AJAXUploader widget is loaded onto the page, it displays, but is disabled. Further, no other buttons rendered on the UserControl are active, and any other widget that attempts to perform a partial page update is blocked. Basically, it shuts down / breaks the rest of the page.

If the AJAXUploader UserControl can function fine on Page, is there a way to insulate its logic to prevent it from breaking other UserControls in the UpdatePanel it is loaded into?
eo_support
Posted: Monday, September 3, 2007 9:00:41 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The reason is because when the page initially rendered without the AJAXUploader, it did not load any javascript modules that the AJAXUploader requires to run. When later you added AJAXUploader to the page via UpdatePanel, the page still does not have the javascript files our AJAXUploader needed because ASP.NET UpdatePanel does not dynamically loads javascript files.

Try using our CallbackPanel instead of ASP.NET UpdatePanel and it should work. One of the major advantage our CallbackPanel over UpdatePanel is that our CallbackPanel dynamically loads javascript modules when necessary. You can still continue to use ASP.NET AJAX for all other features that it offers, such as the drag drop that you were using.

Another way that would require less change, but is also less efficient, is to render AJAXUploader at the very begining, but put it inside a hidden DIV so that it is not visible so that user won't be able to see it.

Thanks
UglyDuckling
Posted: Friday, September 7, 2007 8:58:35 AM
Rank: Member
Groups: Member

Joined: 8/29/2007
Posts: 20
Hello,


First I switched the UpdatePanel to a CallbackPanel and indeed the ASP.NET AJAX code still functioned, though it is slightly slower than using the native ASP.NET UpdatePanel. So far so good.

However, loading the UserControl dynamically with the AJAXUploader within still does not function correctly. The drag and drop script still functions for other modules, but AJAXUploader is locked and disabled as before. Also, postbacks for all other modules continue to get blocked by the presence of the AJAXUploader on the page.

If the AJAXUpload requires javascript and CallbackPanel loads them dynamically, then what else would need to occur for them to work correctly together?
eo_support
Posted: Friday, September 7, 2007 9:02:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I can't think of anything else. Can you post your code so that we can take a look?

Thanks
UglyDuckling
Posted: Friday, September 7, 2007 9:11:46 AM
Rank: Member
Groups: Member

Joined: 8/29/2007
Posts: 20
I can't show the code explicitly but I will try to work up a repro example soon and post it here.

I am thinking that it has more to do with it residing in a UserControl than the CallbackPanel not loading scripts, because I even dropped a visible functional AJAXUpload control onto to the CallbackPanel surface so that all scripts would have loaded to make that control functional, and the presence of the UserControl w/ AJAXUpload still produces the same issues.
eo_support
Posted: Friday, September 7, 2007 9:15:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
UglyDuckling wrote:
I can't show the code explicitly but I will try to work up a repro example soon and post it here.

I am thinking that it has more to do with it residing in a UserControl than the CallbackPanel not loading scripts, because I even dropped a visible functional AJAXUpload control onto to the CallbackPanel surface so that all scripts would have loaded to make that control functional, and the presence of the UserControl w/ AJAXUpload still produces the same issues.


That makes perfect sense. We will be looking into it as soon as we have the repro code.

Thanks
UglyDuckling
Posted: Friday, September 7, 2007 10:24:48 PM
Rank: Member
Groups: Member

Joined: 8/29/2007
Posts: 20
Hello,

Thank you for your quick and knowledgeable responses so far.

While creating the repro I had difficulty reproducing the error and the basic case for this works correctly. So after a lot of debugging using two side-by-side cases I found a seemingly innocuous difference that breaks the code and produces the issue.

The chain of loading goes UpdatePanel --(dynamically loads)--> UserControl(host) ---(dynamically loads)--> UserControl (instance) ----(which has)---> EO.Web controls...

Now my code changes the UserControl(host).ID to a formalized identifier i.e. the name of the type and the instance guid and again when the host loads the instance containing the EO controls. If I do not change the IDs and allow them to load freely, everything on the page renders perfectly. If I change them to anything, it breaks.

Now my issue is that I was using the modified IDs to identify the correct modules to update through web service calls. I'll continue to look for a workaround for requiring the IDs, but I thought you'd like to know the issue.


eo_support
Posted: Saturday, September 8, 2007 6:11:50 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Thanks for the update. What's the exact format of the ID that you use? Can you give an example?

Thanks
UglyDuckling
Posted: Saturday, September 8, 2007 6:57:07 AM
Rank: Member
Groups: Member

Joined: 8/29/2007
Posts: 20
I use the database guid to differentiate between modules of the same type, so a typical id could be ID = "mod9089634e-373c-49f8-8d1e-0d66-99eb-fe3d"
eo_support
Posted: Saturday, September 8, 2007 6:58:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Thanks for the information!
UglyDuckling
Posted: Saturday, September 8, 2007 12:36:01 PM
Rank: Member
Groups: Member

Joined: 8/29/2007
Posts: 20
It turns out that my drag-and-drop functionality is dependent on the ID distinction in order to sort out which div is affected, though I can't sort out why "ctl_ContentPlaceHolder_Moduleefgh-abcd-0123-etc_Module" (renamed in code) is any different than the default "ctl_ContentPlaceHolder_ctl05_Module" (default naming), unfortunately I cannot use EO controls in this scenario unless changing the module no longer affects its operation.
eo_support
Posted: Saturday, September 8, 2007 1:41:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
We've made a new build for you that should address this problem. Please see your private message for download location.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.