Question

Photo of Scott Henry

0

Fetching Data Rockit QuickStart Tutorial Errors

Has anybody successfully completed the Fetching Data step of the Rockit Quickstart tutorial?  I get the following errors when I run my project:

Error 1 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class
Error 2 The name 'gList' does not exist in the current context
Error 3 The name 'upnlContent' does not exist in the current context
Error 4 The name 'gPeople' does not exist in the current context
Error 5 The name 'gPeople' does not exist in the current context
Error 6 The name 'gList' does not exist in the current context
Error 7 The name 'gList' does not exist in the current context

I have the following where I changed the class name to HelloWorldFetchingData:
public partial class HelloWorldFetchingData : Rock.Web.UI.RockBlock
 
On the markup page I changed the inherits to the following:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HelloWorldFetchingData.ascx.cs"
Inherits="RockWeb.Plugins.org_rocket.Tutorials.HelloWorldFetchingData" %>

Any help would be greatly appreciated.  Thanks.

 

 

  • Nick Airdo

    I can vouch that others have successfully completed that tutorial. To help us troubleshoot, you'll need to post your complete code example (both the full .ascx and the .ascx.cs).

  • Photo of Scott Henry

    0

    Thanks for the responses.  I ran into two problems.  The first being I had not capitalized "Web" in the namespace RockWeb.Plugins.org_rocket.Tutorials.   The second problem was that the tutorial guides you in Step 3 to create a grid id called "gPeople" but the ascx.cs file trys to pass the data to a grid called "gList".  I changed the gList to gPeople in the cs code and it runs great but I guess it would also work to call the grid "gList". 

  • Photo of David Turner

    0

    Does your code-behind file ( HelloWorldFetchingData.ascx.cs ) also have a matching namespace?

    namespace RockWeb.Plugins.org_rocket.Tutorials
    {
        public partial class HelloWorldFetchingData : Rock.Web.UI.RockBlock 
        {
            ...
        }
    }