This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi I'm just getting started with Lightspeed and would really appreciate a few pointers. I've created my Lightspeed model - all good. I've created a web form where users will enter data which then gets inserted into the database. At the moment I'm doing this in the code behind like so: using (var uow = _context.CreateUnitOfWork()) That works fine, but is there an easier way to do that (levaraging Lightspeed) within the .aspx markup? I saw in the online store demo some binding using <mindscape:WebDataBinder runat="Server" ID="DataBinder"> but I haven't seen info about what needs to be registered on the page to use those tags or docs on how to use them. Or, should I just use standard Asp.Net form binding to insert into the database and then just use the Lightspeed stuff when I need it for more complex tasks? Advice appreciated. Cheers, Danzig |
|
|
Hi Danzig, The code example you described above would be the standard way of unbinding from an ASP.NET form into a LightSpeed object, so if you are comfortable doing this then there is nothing wrong with this approach. There is nothing that is part of LightSpeed along the lines you are thinking, other than we implement the standard data binding interfaces allowing you to databind to form controls as you would expect to. The "WebDataBinder" you mention above is a sample data binding control we built as part of a Microsoft sample called BackgroundMotion and is contained in the Mindscape.Web.UI.WebControls assembly referenced in the Lib folder of the sample. The declaration for it is in the web.config under the pages/controls section: add tagPrefix="mindscape" namespace="Mindscape.Web.UI.WebControls.Binding" assembly="Mindscape.Web.UI.WebControls" This adds some automated binding/unbinding support which you may find useful, its similar enough to using a ModelBinder with ASP.NET MVC. From memory there are a few other object databinding frameworks around, and any of them should work happily with LightSpeed entities. If you are interested in the code for the WebDataBinder you can find it on the Background Motion codeplex site - you will most likely want everything under the Binding folder :)
Hope that helps, Jeremy |
|
|
Cool, thanks! |
|