Last post Dec 09, 2010 03:17 AM by Qin Dian Tang - MSFT
Dec 07, 2010 04:32 AM|casperdegeus|LINK
I just can't figure out how to approach this, but this is what I want, would be great to get some help:
I have a database-table containing an XML-field. Using LinqToSql I succesfully bound this table to a GridView and a DetailsView control.
Now I wrote a WebUserControl that renders a bunch of textboxes, and has a method 'Serialize' that returns the XElement-object that I can use in my codebehind to assign it to the LinqToSql-property to save it to database. It also has a public property 'Xml'
(type string) that I can use to Bind() the xml-string from the database to it, so the WebUserControl can prefill it's textboxes.
This all works fine when just using the WebUserControl on a custom form, but it (obviously) doesn't when I use the control in a TemplateField of a DetailsView (the prefilling of fields works, but not saving new values to database).
Can anybody tell me what properties/methods a webusercontrol should have to make it function in a TemplateField of a DetailsView-control?
Web User Control Linq To Sql Xml field
Dec 09, 2010 03:17 AM|Qin Dian Tang - MSFT|LINK
I guess what you want is a bindable property in custom control: