I am getting a error for my namespace that says " the type or namespace name could not be found (are you missing a using directive or an assembly reference?) " and have no idea why... i have been trying to figure this one out for hours now... btw i am a newbie with c#

using System;
using System.Data; 
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using portfolioNamespace;  

public partial class DefaultCode : System.Web.UI.Page{

    Portfolio myPortfolio;

    protected void Page_Load(object sender, EventArgs e){
        myPortfolio = new Portfolio();

    private void populate(){
        //populate everything

    private void populateMenu(){
        //populate the menu
        String[] menu;
        menu = myPortfolio.getMyMenu();

        repLinks.DataSource = menu;
        //populates a hidden text box so i can get an array in javascript 
        for (int i = 0; i<=menu.Length - 1; i++){
            dummy.Value = dummy.Value & menu(i) & "-";

    private void populateHome(){
        //populate home 
        homeRepeater.DataSource = myPortfolio.getHomeInfo;

    private void populateSamples(){
        //populate samples
        samplesRepeater.DataSource = myPortfolio.getSamplesInfo;

    private void populateAbout(){
        //populate about
        aboutRepeater.DataSource = myPortfolio.getAboutInfo;


Pas de solution correcte

Autres conseils

In your Solution Explorer Right click your References, click Add Reference > Browse, then find your dll file that contains portfolioNamespace and add it to your References.

See documentation for more details: How to: Add or Remove References By Using the Add Reference Dialog Box

You probably haven't created the portfolioNamespace.

You do so by wrapping your code in

namespace portfolioNamespace
 //your code here

Have a read through these references, namespace (C# Reference) and Namespaces (C# Programming Guide)

It is not clear which file is getting error.

whatever the class name is giving error put cursor on that and press CTRL + DOT(.) it will suggest you to add the correct name space

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top