Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:53:32+00:00 2026-06-09T21:53:32+00:00

I have a website project in VS2010 and, in short, I am using one

  • 0

I have a website project in VS2010 and, in short, I am using one control “BasketMenuItem.ascx” to display the cart details, in summary at the top of the page. What

In the code to render the navigation, I have:

<tp:BasketMenuItem ID="basketMenuItem" runat="server" />

I then have another control, on every product page with a button that adds X number of Product Items to the cart. On adding the items, I use javascript to highlight the cart, i then want to refresh the “BasketMenuItem” control so that the correct details are displayed.

I thought i could do something like (“usercontrols_Global_BasketMenuItem” is the class of the BasketMenuItem control):

(usercontrols_Global_BasketMenuItem)Page.FindControl("basketMenuItem").LoadItems();

However, i get an error saying:

"The Type or Namespace Name BasketMenuItem could not be found (are you missing a using directive or an assembly reference?)"

Im unsure how to get around this. Im not sure what i would need to include, as i cannot simple put:

using usercontrols_Global_BasketMenuItem;

I’ve also tried adding a ClassName attribute to the control file like so:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BasketMenuItem.ascx.cs" ClassName="BasketMenuItem" Inherits="usercontrols_Global_BasketMenuItem" %>

Yet i still cannot manage to reference it.

The Code

First of all, there is the BasketMenuItem control. Both ascx and ascx.cs. This contains the methods to load the contents of the current basket. “LoadItems()”.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BasketMenuItem.ascx.cs" ClassName="BasketMenuItem" Inherits="BasketMenuItem" %>

public partial class BasketMenuItem : System.Web.UI.UserControl
{
    //...
}

Then, there is the Menu control. This is where the Basket control is placed on the page in the navigation:

<ul>
    <li>...</li>
    <li>...</li>
    <li>...</li>

    <!-- Cart -->
    <tp:BasketMenuItem ID="basketMenuItem" runat="server" />

</ul>

Finally, there is the ListItems Control, defined as follows. This control contains the button to add items into the cart. Here I want to find the BasketMenuItem control on the page and call its “LoadItems()” methods to update.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ListItems.ascx.cs" Inherits="ListItems" %>

public partial class ListItems : System.Web.UI.UserControl
{
    //...
}

No namespaces have been specified, from what I have read I would assume I could find the BasketItem control in the ASP namespace. But i cannot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:53:34+00:00Added an answer on June 9, 2026 at 9:53 pm

    You are on the right track with the using statement. But instead of doing a using statement with the classname, you need to use the namespace of the control.

    If you open up the codebehind (.cs) of your usercontrols_Global_BasketMenuItem control you should be able to find the namespace you need to include by looking for the namespace clause in the code file.

    Also, while in that file you should verify whether the class name is ‘usercontrols_Global_BasketMenuItem’ or is ‘BasketMenuItem’. The latter seems more likely.

    If you do not have namespaces, you can try using the “global::” namespace and accessing it that way, or aliasing it in a using statement. See this post for details: explicitly refer to a class without a namespace in C#

    However, I strongly suggest updating to add namespaces. Architecturally you will find it much easier to work with your codebase and have similar class names if you have proper namespace structures.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website project that I want to build using CruiseControl.net. On one
I have a Website project that I'm trying to debug using Fiddler. Fiddler doesn't
We have a ASP.NET website project. In the past, we had been using asmx
we have just started using a git account of our Django website project so
I am using a 3rd party control in a website project in VS 2010
I have deployed a website using Visual Studio 2010 on IIS6. I used one
I am using asp.net 4, vs 2010. I have a WebSite project, with some
I have a website project, and using Linq to SQL in it. Currently, I
I have a WebSite project in VS2010. Folder structure is like: ../packages ../Website ../Website.DataAccess
I have a website project (C#/ASP.NET) opened in Visual Studio 11 (beta) which works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.