Example does not compile

4 posts, 0 answers
  1. henky
    henky avatar
    1 posts
    Member since:
    Dec 2006

    Posted 30 Mar 2009 Link to this post

    Hi,

    I am getting this error when trying the CarRentalWeb sample application.

    Error 2 'CarRentalWeb.CarRentalMaster' does not contain a definition for 'Scope' and no extension method 'Scope' accepting a first argument of type 'CarRentalWeb.CarRentalMaster' could be found (are you missing a using directive or an assembly reference?) C:\Source\SofiaRentalCar\CarRentalWeb\AdvancedSearch.aspx.cs 20 39 CarRentalWeb

    scopeHolder = (

    CarRentalMaster)this.Master;

     

    cashedScope = scopeHolder.Scope;


    it's complaining about the second line that I copied and pasted from the tutorial page.

    Please advise.

    TIA.

    Henry
  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 30 Mar 2009 Link to this post

    Hi henky,
    you will firstly need to create the scope that we are using in the examples. This is done by pasting the following code into the code behind of the master page.
     using System; 
     using System.Collections.Generic; 
     using System.Linq; 
     using System.Web; 
     using System.Web.UI; 
     using System.Web.UI.WebControls; 
     using Telerik.OpenAccess; 
     using OpenAccessData; 
      
     namespace CarRentWebSite 
     { 
         public partial class CarRentMaster : System.Web.UI.MasterPage 
         { 
             private IObjectScope scope = ObjectScopeProvider1.GetNewObjectScope(); 
      
             public IObjectScope Scope 
             { 
                 get { return scope; } 
                 set { scope = value; } 
             } 
            
             protected void Page_Load(object sender, EventArgs e) 
             { 
                
             } 
             public override void Dispose() 
             { 
                 scope.Dispose(); 
                 base.Dispose(); 
             } 
         } 
     } 


    Sincerely yours,
    PetarP
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Michael
    Michael avatar
    1 posts
    Member since:
    Apr 2009

    Posted 28 Apr 2009 Link to this post

    This essential step would probably be good to include in the tutorial.
  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 29 Apr 2009 Link to this post

    Hello Michael,
    this fell off from the help by misstake in our previous release. We did fix it in our last release though.

    Greetings,
    PetarP
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top