Thursday, February 15, 2007

Using A Class From A Seperate Assembly With An ObjectDataSource

First, add a reference to the assembly at the top of the page:

<%@ Register TagPrefix="MyAssembly" Namespace="MyAssembly.Data" Assembly="MyAssembly, Version=1.0.0.1, Culture=neutral, PublicKeyToken=zj1251fcc32b5cg6" %>


Now set the ObjectDataSource's "TypeName" property to the specific class:

TypeName="MyAssembly.Data.MyDataClass"

Now right click on the object data source in design view and select 'Configure Data Source' and you'll see the methods on your class to choose from.





No comments:

Fixes to common .NET problems, as well as information on .NET features and solutions to common problems that are not language-specific.

Fixes to common .NET problems, as well as information on .NET features and solutions to common problems that are not language-specific.

Z