When editting a record it saves everything except the image itself.
Now I do remember an older post of mine where I was talking about "DynamicDataFutures.DisablePartialRenderingForUpload".
Which method is this in the .NET 4.0 version?
Now I do remember an older post of mine where I was talking about "DynamicDataFutures.DisablePartialRenderingForUpload".
Which method is this in the .NET 4.0 version?
In fact Sjnaughton's articles have talked about this method, If I take you right, I think this method is written by yourself, something looks like this following:
public static void DisablePartialRenderingForUpload(Page
page, MetaTable table)
{ foreach (var
column in table.Columns)
{ // TODO this depends on the name of the field template, need to fix if (String.Equals(column.UIHint,
"DBImage", StringComparison.OrdinalIgnoreCase)
|| String.Equals(column.UIHint,
"FileImage", StringComparison.OrdinalIgnoreCase))
{ var sm =
ScriptManager.GetCurrent(page); if (sm !=
null)
{
sm.EnablePartialRendering = false;
} break;
}
}
}
It should have no relation with version of net framework, because it's a DIY method.
Do you have a sample project by any chance?
I still can't get anything uploaded ... in the UploadImage_Edit template in the ExtractValues method my FileUpload1.HasFile is always false for some reason ... happen to have an idea?
Well I need EnablePartialRendering to be true for other reasons, what do I do now?
I did try to turn it to false and like you said it works in that case, but as you can understand I need the partialrendering for the rest of the app to run smoothly.
Where exactly do I call that extention method?
Hi Yannick, EnablePartialRender="true" uses AJAX post back to make the page update without a full postback, so no it is not essential but it does make your page updates look smoother.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
Yannick86
Member
565 Points
366 Posts
Image Field Template - Can't upload
Nov 15, 2011 08:50 AM|LINK
Guys,
In my project I'm using Sjnaughton's image field template, but I can't seem to be able to upload anything.
The template:
http://csharpbits.notaclue.net/2011/07/dynamic-data-image-field-template.html
When editting a record it saves everything except the image itself.
Now I do remember an older post of mine where I was talking about "DynamicDataFutures.DisablePartialRenderingForUpload".
Which method is this in the .NET 4.0 version?
Regards,
- Yannick
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Image Field Template - Can't upload
Nov 17, 2011 12:29 AM|LINK
In fact Sjnaughton's articles have talked about this method, If I take you right, I think this method is written by yourself, something looks like this following:
public static void DisablePartialRenderingForUpload(Page page, MetaTable table)
{
foreach (var column in table.Columns)
{
// TODO this depends on the name of the field template, need to fix
if (String.Equals(column.UIHint, "DBImage", StringComparison.OrdinalIgnoreCase)
|| String.Equals(column.UIHint, "FileImage", StringComparison.OrdinalIgnoreCase))
{
var sm = ScriptManager.GetCurrent(page);
if (sm != null)
{
sm.EnablePartialRendering = false;
}
break;
}
}
}
It should have no relation with version of net framework, because it's a DIY method.
If I took you wrongly, please tell me kindly:)
Best reguards!
http://csharpbits.notaclue.net/2008/07/dynamic-data-part-2-fileimageedit.html (This is where I referred the article)
sjnaughton
All-Star
27330 Points
5459 Posts
MVP
Re: Image Field Template - Can't upload
Nov 17, 2011 12:36 PM|LINK
Try using the new one from NuGet here Dynamic Data Custom Field Templates
Always seeking an elegant solution.
Yannick86
Member
565 Points
366 Posts
Re: Image Field Template - Can't upload
Nov 18, 2011 12:59 PM|LINK
Stephen,
That link doesn't seem to work.
Regards,
- Yannick
sjnaughton
All-Star
27330 Points
5459 Posts
MVP
Re: Image Field Template - Can't upload
Nov 18, 2011 01:37 PM|LINK
Thsi seems to happen all the time the system messes up my URLs
Arrgh!
I'll fix it
Always seeking an elegant solution.
sjnaughton
All-Star
27330 Points
5459 Posts
MVP
Re: Image Field Template - Can't upload
Nov 18, 2011 01:38 PM|LINK
it's fixed
Always seeking an elegant solution.
Yannick86
Member
565 Points
366 Posts
Re: Image Field Template - Can't upload
Dec 07, 2011 09:33 AM|LINK
Stephen,
Do you have a sample project by any chance?
I still can't get anything uploaded ... in the UploadImage_Edit template in the ExtractValues method my FileUpload1.HasFile is always false for some reason ... happen to have an idea?
Thanks in advance,
- Yannick
sjnaughton
All-Star
27330 Points
5459 Posts
MVP
Re: Image Field Template - Can't upload
Dec 07, 2011 12:27 PM|LINK
You will need to turn Partial rendering off in the site .master to do that or use thos extension method,
/// <summary> /// Disables the partial render. /// </summary> /// <param name="page">The page.</param> public static void DisablePartialRender(this Page page) { var sm = ScriptManager.GetCurrent(page); if (sm != null) sm.EnablePartialRendering = false; }Always seeking an elegant solution.
Yannick86
Member
565 Points
366 Posts
Re: Image Field Template - Can't upload
Dec 15, 2011 10:51 AM|LINK
Well I need EnablePartialRendering to be true for other reasons, what do I do now?
I did try to turn it to false and like you said it works in that case, but as you can understand I need the partialrendering for the rest of the app to run smoothly.
Where exactly do I call that extention method?
Regards,
- Yannick
sjnaughton
All-Star
27330 Points
5459 Posts
MVP
Re: Image Field Template - Can't upload
Dec 16, 2011 09:41 AM|LINK
Hi Yannick, EnablePartialRender="true" uses AJAX post back to make the page update without a full postback, so no it is not essential but it does make your page updates look smoother.
Always seeking an elegant solution.