Asp.Net xxxView controls and InsertTemplates

Asp.Net xxxView controls and InsertTemplates

Old forum URL: forums.lhotka.net/forums/t/5295.aspx


ajj3085 posted on Monday, August 25, 2008

Hi,

I think I've discovered something, and am wondering now if this is behavior that is by design.

It seems that if you create an object and have it bound while in an InsertItemTemplate, the values in the newly created BO are NOT used to populate the controls.  It seems to assume that if you are inserting a new object, there's no need to populate the controls values from the BO.  Maybe you're supposed to specify defaults elsewhere?

Anyway, sorry if this isn't new to anyone but me, but I have been out of asp.net for a while.. Smile [:)]

pfeds replied on Tuesday, August 26, 2008

I think you're right.  I read about this scenario before somewhere.

As the form is in Insert mode then by design it assumes that binding isn't necessary.  Consider it from a different viewpoint - if you have an object that you have set defaults on then technically you have already created it and are now in the process of editing it.  So with that in mind then I guess you want your form view to be in Edit mode Stick out tongue [:P]

Copyright (c) Marimer LLC