Last post Jul 17, 2012 10:32 AM by sewells1951
Jul 17, 2012 10:24 AM|sewells1951|LINK
Having a little trouble with the UIHint attribute. Specifically I need to use one field template during the insert and another during the edit. Is there a way to do this with the UIhint attribute? I've tried modifying one template to detect when the action
is insert and do one thing and when it's edit do another. However, doing this in the template always returns the action as a null result. The code I'm using in the field template is this
RouteData route = DynamicDataRouteHandler.GetRequestContext(Context).RouteData;
DynamicDataRoute ddRouteData = route.Route as DynamicDataRoute;
string action = ddRouteData.Action;
from here: http://justgeeks.blogspot.com/2010/11/getting-action-or-dynamicdataroute-from.html
But, it would work equally well to simply have one template that acts like an edit template on insert but not on edit and another that works as an edit on the edit and not on insert.
Any way to specify which mode a UIHint works for?
Thanks in advance.
Jul 17, 2012 10:32 AM|sewells1951|LINK
Sorry, I posted prematurely. The suffix determines this. If you need what I need you simply add a suffice consisting of _edit and _insert respectively to the user control base name.