This is just what I was looking for, and posted only 2 hours before I needed it, good timing! And a "local" too!
One small thing... there is a slight typo in your code listing for
FileImageTypesAttribute where you have got DefaultExtansions rather than
DefaultExtensions.
Thank you very much for the code. I think I am missing something. This project is available for download in several places and I am not sure which one is the latest version.
I am getting errors:
The type or namespace name 'FileImage' could not be found (are you missing a using directive or an assembly reference?)
I think I am missing a class file. Can you point me to the latest download or email me the the complete project.
Hey Steve, thanks a lot. I finally got it to work in VB. Now for the next step I need to use this FileImage image API with a custom page. It don't seem to work if I turn off the autogeneraterow to false. Is there a easy way to configure the custom page to
use this API?
It don't seem to work if I turn off the autogeneraterow to false. Is there a easy way to configure the custom page to use this API?
It will not work if you set AutogenerateRow to false you must set up the columns using
DynamicControl or DynamicField this allows the the GridView etc to put the correct
FieldTemplate in place. To do this on a new page you will need to add an
DynamicDataManager and point it at the the GridView etc control see below.
whether your customising a page or creating a completely new page it's the same after that you must add the columns you want to display as in a normal customised gridview but replace the normal controls in the ItemTemplate/EditTemplate etc with DynmaicField/DynamicControl see below for an example of the columns collection.
The FileImageHelper.DisablePartialRenderingForUpload(Me, table) line disables partial rendering whenever there is a DBImage or FileImage FieldTemplate on the page due to the FileUpload having a security
issue with partial render, so it's by design that the main updatepanel updates.
Dynamic DataDBImageFileImagePartial Render
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
robroe
Member
18 Points
19 Posts
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 03, 2008 04:10 PM|LINK
Hi Steve,
This is just what I was looking for, and posted only 2 hours before I needed it, good timing! And a "local" too!
One small thing... there is a slight typo in your code listing for FileImageTypesAttribute where you have got DefaultExtansions rather than DefaultExtensions.
Many thanks,
Rob
sjnaughton
All-Star
27318 Points
5458 Posts
MVP
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 03, 2008 05:28 PM|LINK
Yep I can't type, I must have spell checked some of the code when I posted it to my blog but not all of it; sorry I try harder next time [:D]
I just fixed it an reposted, Oh yeh and I can't spell either. [I wish this editor had a spell checker] [;)]
Dynamic Data Field Templates FileImage FileImage_Edit
Always seeking an elegant solution.
Tareq
Member
678 Points
273 Posts
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 07, 2008 01:13 PM|LINK
Hey Steve,
Thank you very much for the code. I think I am missing something. This project is available for download in several places and I am not sure which one is the latest version.
I am getting errors:
The type or namespace name 'FileImage' could not be found (are you missing a using directive or an assembly reference?)
I think I am missing a class file. Can you point me to the latest download or email me the the complete project.
Thanks again,
Tareq
sjnaughton
All-Star
27318 Points
5458 Posts
MVP
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 07, 2008 02:01 PM|LINK
Hi Tareq, e-mail me by clicking Send sjnaughton an email and I'll reply with the website file zipped up. [:D]
Dynamic Data FileImage FileImage_Edit
Always seeking an elegant solution.
Tareq
Member
678 Points
273 Posts
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 08, 2008 10:37 PM|LINK
Hey Steve, thanks a lot. I finally got it to work in VB. Now for the next step I need to use this FileImage image API with a custom page. It don't seem to work if I turn off the autogeneraterow to false. Is there a easy way to configure the custom page to use this API?
Thanks,
Tareq
scothu
Participant
1436 Points
291 Posts
Microsoft
Moderator
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 08, 2008 11:07 PM|LINK
To use Dynamic Data with autogenerate turned off you have two options:
1) Put a DynamicField into the list of columns for the GridView/DetailsView and specify the fieldname.
2) Create a TemplateField and put a DynamicControl into the list of columns for the GridView/DetailsView and specify the fieldname.
If this doesn't answer your question then show us an example of your data control with autogenerate turned off.
PM, ASP.NET Team, Microsoft
sjnaughton
All-Star
27318 Points
5458 Posts
MVP
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 08, 2008 11:37 PM|LINK
It will not work if you set AutogenerateRow to false you must set up the columns using DynamicControl or DynamicField this allows the the GridView etc to put the correct FieldTemplate in place. To do this on a new page you will need to add an DynamicDataManager and point it at the the GridView etc control see below.
whether your customising a page or creating a completely new page it's the same after that you must add the columns you want to display as in a normal customised gridview but replace the normal controls in the ItemTemplate/EditTemplate etc with DynmaicField/DynamicControl see below for an example of the columns collection.
Dynamic Data Custom Pages
Always seeking an elegant solution.
Tareq
Member
678 Points
273 Posts
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 09, 2008 01:20 AM|LINK
Thanks guys. That resolved the issue. You guys are awesome.
Tareq
Member
678 Points
273 Posts
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 10, 2008 07:34 PM|LINK
Hey Guys,
I stumbled on another issue. Due to the line in insert.aspx
FileImageHelper.DisablePartialRenderingForUpload(
Me, table) is creating issue for me to to do a partial update on a template field inside the detailsview. More details of this post is posted here:http://forums.asp.net/t/1288000.aspx
Whenever I try to update another updatepanel it keeps refreshing the main updatepanel. Any ideas how this can be resolved?
Thanks again,
Tareq
sjnaughton
All-Star
27318 Points
5458 Posts
MVP
Re: Anyone know how to use the FileImageAPI Edit Funtionality?
Jul 10, 2008 07:44 PM|LINK
The FileImageHelper.DisablePartialRenderingForUpload(Me, table) line disables partial rendering whenever there is a DBImage or FileImage FieldTemplate on the page due to the FileUpload having a security issue with partial render, so it's by design that the main updatepanel updates.
Dynamic Data DBImage FileImage Partial Render
Always seeking an elegant solution.