|
Rank: Newbie Groups: Member
Joined: 2/21/2009 Posts: 4
|
When using a custom layout template for the AJAXUploader and the template is loaded from an ascx file, the file input control is not inserted into the "InputPlaceHolder" placeholder - why not??
In a page class: myUploader.LayoutTemplate = this.LoadTemplate("/templates/uploaderTemplate.ascx");
When inserting the layout template directly into the page file, it work though!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Try to call the code inside your Page_Init and see if it works. I believe if LayoutTemplate is initialized too late the uploader won't be able to pick it up.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 2/21/2009 Posts: 4
|
Hi,
Hmm - the template is actually set in the page OnInit method:
protected override void OnInit(EventArgs e) { base.OnInit(e); ..Some stuff myUploader.LayoutTemplate = this.LoadTemplate("/templates/uploaderTemplate.ascx"); ..Some stuff }
Even doing it in OnPreInit won't do the job :-/
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We looked further into this issue and noticed that this occurs because the parent/child relationship is different when using LoadTemplate. The parent child relationship is:
AJAXUploader -> Layout container -> InputPlaceHolder
With LoadTemplate the parent child relationship is:
AJAXUploader -> Layout container -> your_ascx -> InputPlaceHolder
Unfortunately I do not see an easy way to workaround this issue. One workaround is to create your own class that implements ITemplate, which calls LoadTemplate to load the "ascx -> InputPlaceHolder" version first, then get all the child controls of the root ascx control, then "move" all these child controls as direct child controls of the template container (the container argument passed to your InstantiateIn method. However this will lose whatever logic that you have on your ascx level, and it is also quite complicate. So it may not worth the effort.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 2/21/2009 Posts: 4
|
Hi,
OK - thanks. I will work around this somehow.
I will implement the template in the page instead.
Funny that only the input is not found (the progress and buttons seems to be initialized fine) - but i'm not gonna dig deaper into this - thats why i bought your fine product the first way.
Would be nice to be able to put own logic into the template in future releases though :-)
Thanks..
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Thanks for the update. We will look into it and see if we can support that in our future release.
|
|