HI all, im designing and programming my first dnn module, and i want to have a gridview populated, but not in page load, but at a button press... for that and another reasons i want to wire the grid from code behind, and ill like to know if someone can give me a hand on this.
I already coded the dal and th bl, now i just want to pass on the databjects, heres my approach:
ObjectDataSource Cat = new ObjectDataSource();
Cat.DataObjectTypeName = YourCompany.Modules.Catalogo.CatalogoInfo;
Cat.DeleteMethod = "DeleteCatalogo";
Cat.InsertMethod = "AddCatalogo";
Cat.SelectMethod = "GetCatalogo";
Cat.UpdateMethod = "UpdateCatalogo";
Cat.TypeName = "CatalogoController";
Cat.SelectParameters.Add("Moduleid", TypeCode.Int32, "00");
Cat.SelectParameters.Add("Cod_Artic", TypeCode.String, "00");
GridView1.DataSource = Cat;
GridView1.DataBind();
but i get this error:
DotNetNuke.Services.Exceptions.ModuleLoadException: c:\Inetpub\wwwroot\DotNetNuke\DesktopModules\Catalogo\ViewCatalogo.ascx.cs(126): error CS0119: 'YourCompany.Modules.Catalogo.CatalogoInfo' is a 'type', which is not valid in the given context ---> System.Web.HttpCompileException: c:\Inetpub\wwwroot\DotNetNuke\DesktopModules\Catalogo\ViewCatalogo.ascx.cs(126): error CS0119: 'YourCompany.Modules.Catalogo.CatalogoInfo' is a 'type', which is not valid in the given context at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---
Can anyone point me in the right direction? i´ve found a lot of examples wireing the grid on the client side, but none un the codebehind, tanks a lot for your time.
Farewell