www.webdeveloper.com
Results 1 to 2 of 2

Thread: Error in C# Code for ASP.net site

  1. #1
    Join Date
    Aug 2008
    Posts
    11

    Error in C# Code for ASP.net site

    I am following along a book I purchased, ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio

    I am getting the following errors:


    Error 1 The name 'MenuTabs1' does not exist in the current context C:\Documents and Settings\iweiss\my documents\visual studio 2010\Projects\Elite Tool Kit\UI\EliteToolKit.Master.cs 21 9 UI


    Error 2 The name 'Globals' does not exist in the current context C:\Documents and Settings\iweiss\my documents\visual studio 2010\Projects\Elite Tool Kit\UI\EliteToolKit.Master.cs 21 31 UI

    EliteToolKit.Master.Cs

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Xml.Linq;
    using BLL.Framework;
    using FrameworkControls;

    public partial class EliteToolKit : System.Web.UI.MasterPage
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    //Set the top menu properties
    MenuTabs1.Menuitems = Globals.GetMenuItems(this.Cache);


    }
    }

    Global.cs (which is in App-Code)

    using System;
    using System.Data;
    using System.Configuration;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Web.Caching;
    using BLL.Framework;


    /// <summary>
    /// Summary description for Globals
    /// </summary>
    public static class Globals
    {
    #region Constants

    private const string CACHE_KEY_MENU_ITEMS = "MenuItems";
    private const string CACHE_KEY_USERS = "Users";

    #endregion Constants

    #region Methods

    public static ENTMenuItemBOList GetMenuItems(Cache cache)
    {
    //Check if the menus have been cached.
    if (cache[CACHE_KEY_MENU_ITEMS] == null)
    {
    LoadMenuItems(cache);
    }

    return (ENTMenuItemBOList)cache[CACHE_KEY_MENU_ITEMS];
    }

    public static ENTUserAccountEOList GetUsers(Cache cache)
    {
    //Check for the users
    if (cache[CACHE_KEY_USERS] == null)
    {
    LoadUsers(cache);
    }

    return (ENTUserAccountEOList)cache[CACHE_KEY_USERS];
    }

    public static void LoadMenuItems(Cache cache)
    {
    ENTMenuItemBOList menuItems = new ENTMenuItemBOList();
    menuItems.Load();

    cache.Remove(CACHE_KEY_MENU_ITEMS);
    cache[CACHE_KEY_MENU_ITEMS] = menuItems;
    }

    public static void LoadUsers(Cache cache)
    {
    ENTUserAccountEOList users = new ENTUserAccountEOList();
    users.Load();

    cache.Remove(CACHE_KEY_USERS);
    cache[CACHE_KEY_USERS] = users;
    }

    #endregion Methods
    }

    Any ideas???

    Thanks!

  2. #2
    Join Date
    Oct 2006
    Posts
    52
    Hi

    Is there an item on the .aspx page for the master page?

    Not used the app-code directory before, but it could be that you need to include the class with a "using..." statement because it is not in a namespace.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles