This is a migrated thread and some comments may be shown as answers.

Example does not compile

3 Answers 79 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
henky
Top achievements
Rank 1
henky asked on 30 Mar 2009, 05:15 AM
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

3 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 30 Mar 2009, 09:40 AM
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.
0
Michael
Top achievements
Rank 1
answered on 28 Apr 2009, 06:00 PM
This essential step would probably be good to include in the tutorial.
0
PetarP
Telerik team
answered on 29 Apr 2009, 10:01 AM
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.
Tags
Getting Started
Asked by
henky
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Michael
Top achievements
Rank 1
Share this question
or