Last post Nov 02, 2007 01:03 PM by TG57
Nov 02, 2007 10:57 AM|TG57|LINK
Simple question really.
Am I going down the wrong track putting a DataSource inside a custom control or is this just the wrong way to go about things?
Nov 02, 2007 11:56 AM|ecbruck|LINK
Why don't you simply inherit form something like a DataBoundControl, then you can just set the DataSource property of your control to your actual data source.
Nov 02, 2007 01:03 PM|TG57|LINK
Thanks for the reply
Currently I have a sqldatasource and a FormView (with the template I want) in the custom control and am setting a public property of the custom control which I've linked to a parameter of the sqldatasource.
I've just got to the stage of wondering if it's not better to have the SqlDatasource and FormView separate on the webform.
Well I followed http://msdn.microsoft.com/en-us/library/ms366540(VS.80).aspx then modified it to do the job. But I think just a FormView is probably the way to go.
Thanks for the pointer.