Welcome Guest Search | Active Topics | Sign In | Register

Ajax Uploader - Programmatically Creating Layout Template Options
PDG
Posted: Tuesday, January 31, 2012 3:09:39 PM
Rank: Advanced Member
Groups: Member

Joined: 12/19/2010
Posts: 47
Do you have any sample code for this? I am being forced to use this because of what is poor behavior on the part of the control. Look at the image attached, notice that the control blew through both an asp.net panel and an asp.net table control. For some reason it did not wrap the text of the uploaded file name (actually, I cannot upload the screen capture).

Your sample code only uses a Layout Template in the asp page.

eo_support
Posted: Tuesday, January 31, 2012 3:14:10 PM
Rank: Administration
Groups: Administration

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

You basically want to create an object that implements ITemplate and pass that object to the uploader. This would be exactly the same for creating a template for any control. You can search online and you should be able to find plenty of information about how to do that.

The only thing particular when you create a template for the uploader is the uploader recognizes several different "special IDs" in the template. However this part is the same regardless whether you create your template programmatically or in your aspx. You can take a look of the LayoutTemplate documentation to get a list of special IDs.

Thanks!
PDG
Posted: Tuesday, January 31, 2012 9:14:38 PM
Rank: Advanced Member
Groups: Member

Joined: 12/19/2010
Posts: 47
Ok, I have the templating working. Pretty cool. However, are you aware that your control blows through table boundaries? That is to say that it somehow displays beyond the limit of the table cell. Assuming that you are aware of this, do you have a workaround? If not, the control, which is very powerful, is somewhat worthless. Sorry, nothing personal, but my app allows the user to create dynamic tables and place form controls within the tables. However, the control messes up those tables and I cannot in good conscience use this control. If you are not aware of this, I can show it to you quite easily. I use both a table created in the asp page and a table created programmatically. It blows right through both. Ouch! You have my email, let me know I can setup a webex and show you.
eo_support
Posted: Wednesday, February 1, 2012 9:34:03 AM
Rank: Administration
Groups: Administration

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

The control renders HTML and there are all sorts of scenarios where inner HTML elements would render overlap with outer HTML depending on your CSS settings. So neither we are surprised that it occurs, nor would we automatically consider it a problem. The default style should work fine for most cases. If it's causing problem for you, you can try to adjust your HTML/styles to see if you can work around it --- this is especially the case when even the HTML templated used by the control are created by you, so you have control over both sides.

There is no difference between static HTML and dynamically created HTML.

Thanks!
PDG
Posted: Wednesday, February 1, 2012 12:36:19 PM
Rank: Advanced Member
Groups: Member

Joined: 12/19/2010
Posts: 47
Thanks for the reply. I did get the control to display correctly. There are probably many ways to accomplish this as you stated in your reply. I templated the control and omitted the showing of the uploaded file name and delete, since that functionality is controlled elsewhere. Also, we cannot allow our users to delete anything as our system operates in a regulated environment. I added to the template a simple label and then added an event handler for the upload which finds the label control and adds the file name and a message, which accomplishes what I omitted without the delete. Then to be sure not to overrun the boundary of the table, I check the length of the file name and truncate it if it exceeds the boundary. This seems to work well. Thanks again.


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.