C # access class inside App_Code folder

Im new for C # and im creating a new web application. As usual, I create a library of public functions used by the application as a whole.

I use VS.net 2008, I created a new project project with the following structure: root --App_Code globalClass.cs --scripts Default.aspx Default.aspx.cs

I need to import / use globalClass inside App_Code / globalClass.cs Inside Behind of Default.aspx or whatever.

This is the contents of App_Code / globalClass.cs

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;


namespace sgmedcs.globalClass
{
    public class claseGlobalX : System.Web.UI.Page
    {
        //HttpContext httpActual = HttpContext.Current;

        public string cargarSQL(string queryStr, string queryType)
        {
          //Scripting
        }
    }
}

I also used sgmed.App_Code.globalClass and sgmedcs.AppCode.globalClass as the namespace

In Default.aspx.cs, I added the use of sgmedcs.globalClass; Or using sgmed.App_Code.globalClass; Or using sgmedcs.AppCode.globalClass

" " claseGlobal " " sgmedcs "( ?)"

, .

+4
2

Compile.

+14

: "-", "-", . . , App_Code , , . , , , , IIS , , App_Code , -, , , App_Code .

0

All Articles