I am using ASP:ObjectDataSource to bind grid data.
My problem is that when I run this code, I get an error.
<asp:ObjectDataSource ID="odsListing" runat = "server" SelectMethod = "MethodNameOfCodeBehindClass" TypeName = "FolderName_CodeBehindClassName" ></asp:ObjectDataSource>
Error message
The type specified in the TypeName property of ObjectDataSource 'odsListing' could not be found.
Therefore, I am moving my code to the codebehind site.
#region ObjectDataSource for Grid Binding Type type = typeof(FolderName_CodeBehindClassName); string assemblyQualifiedName = type.AssemblyQualifiedName; odsListing.TypeName = assemblyQualifiedName; odsListing.SelectMethod = "ListingDatabind";
Now everything is all right. This is a job. But I would like to know the actual solution to my problem. Why does this cause an error?
In fact, I do not want to move my code to the codebehind layer if it can write at the development level.
Every suggestion will be appreciated.
source share