OpenAccess with Telerik MVC another problem

2 posts, 0 answers
  1. Michał
    Michał avatar
    6 posts
    Member since:
    Apr 2009

    Posted 18 Mar 2010 Link to this post

    Hello,

    I try to use OpenAccess with Telerik MVC Grid. I create View based on "Telerik MVC Samples" samples:
    <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CustomerDto>>" %> 
    (...)  
    <%= Html.Telerik().Grid(Model)  
            .Name("Grid")   
            .Columns(columns =>   
            {   
                columns.Bound(c => c.Id).Width(100);  
                columns.Bound(c => c.Fax).Width(200);  
                columns.Bound(c => c.Phone);  
                columns.Bound(o => o.CreateDate).Format("{0:MM/dd/yyyy}").Width(120);  
            })   
    %> 
    (...) 
    When CustomerDto is OpenAccess persistent class. And in controller I put:
    IObjectScope scope = ObjectScopeProvider.GetPerRequestScope();  
    IQueryable<CustomerDto> customers = scope.Extent<CustomerDto>();  
     
    return View(new GridModel(customers));  
     
    I reference Telerik.OpenAcess.dll and Telerik.OpenAccess.35.Extensions.dll and after run application I see:
    Compiler Error Message: CS0012: The type 'Telerik.OpenAccess.SPI.dataobjects.PersistenceCapable' is defined in an assembly that is not referenced. You must add a reference to assembly 'Telerik.OpenAccess, Version=2010.1.310.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342'.  
    Line 164:      
    Line 165:    [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]  
    Line 166:    public class views_home_about_aspx : System.Web.Mvc.ViewPage<IEnumerable<CustomerDto>>, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {  
    Line 167:          
    Line 168:        private static bool @__initialized; 
  2. Michał
    Michał avatar
    6 posts
    Member since:
    Apr 2009

    Posted 18 Mar 2010 Link to this post

    I found a solution. I need to put:
    <add assembly="Telerik.OpenAccess, Version=2010.1.312.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" /> 

    In web.config:
    <configuration> 
      <system.web> 
        <compilation debug="true">  
          <assemblies> 
            <add assembly="Telerik.OpenAccess, Version=2010.1.312.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" /> 
            (...) 
  3. DevCraft banner
Back to Top