Accessing Class File In App_Code Not Orking?

Jul 1, 2010

While working on my FTP server, I am trying to access a class within my App_Code, but it is not working.When writing, the class is accessible/usable in the code like shown in picture. I get no build errors.But when I run it in the browser, I get an error stating that it cannot find my class.I've looked around some other posts on the forum, like using namespace, but it didn't work.

View 8 Replies


Similar Messages:

Can't Use Class In .cs File Under App_code?

Apr 10, 2010

I've developed a class and it is put in a .cs file under the app_code folder. The class is a public one and there is no namespace specifically defined for this class in the file.of my webpages uses this class. It works ok on my local machine. However after I uploaded the page to the web server and then try to display the page through internet, the sever told me the class name can not be found.

View 3 Replies

Security :: How To Get Windows Username From A Class File In App_Code

Jul 1, 2010

this is relatively simple, but how would i go about retrieving the windows login name from the class file in the App_Code folder. I have set up my website to run windows authentication, and can use httpcontext to get windows login name from code beihind, but without passing this to the class everytime, is it possible to get the login name from within the class?

View 2 Replies

Application Does Not Recognize Class File In App_Code VS 2010

Jan 23, 2011

Since App_Code doenst exist as an ASP.NET Folder, I manually added App_Code as a regular folder, then within that I placed technologydescriptor.cs. Although it now has the appearance of an ASP.NET Folder.But for some reason my code doesnt recognize this class if its w/in the App_Code folder. This is picked up if it is not within that folder- why?Error: "The type or namespace name could not be found, are you missing a using directive or assembly reference"

[Code]....

View 4 Replies

C# - Can Apply Common Namespace From Web.config To App_code Class File

Nov 14, 2010

I am relatively new to asp.net environment.Recently working on a project, i discovered a problemi.e. I had to add using system.io to all file functions in any page. same for using sql functionsi.e. any method for that namespace had to be used in full like By adding the following section in web.config , ALL my pages automatically have access to that namespace

<namespaces>
<add namespace="System.Data"/>
<add namespace="System.Data.SqlClient"/>
<add namespace= "MySql.Data.MySqlClient"/>
<add namespace="System.IO"/>
</namespaces>
[code]...

View 2 Replies

Visual Studio :: New Class File In App_Code In Vs 2010 In New Web Project Not Compiling

May 23, 2010

Best way to describe my issue with vs 2010.create a new website. create the App_Code folder. create a new class in the folder. put the line "x" in the class declaration. hit compile. And the website will compile with no errors. It's not "seeing" this new class as being part of the project best I can tell.

View 1 Replies

Accessing A Class File In VB Or C#?

Nov 24, 2010

I want to access the functions defined in ADO.vb file in my Default.aspx.vb file. note that the ADO.vb file is in the root directory. I can access it if it is in the App_Code directory. It it is in the root directory how can i access that?

View 9 Replies

List All Classes In Application (Including Class In App_Code And Partial Class(aspx Pages And Asmx User Controls)?

Nov 15, 2010

Is there any way to list all the class in my ASP.Net application(Including class in App_Code and Partial Class(aspx pages and asmx user controls)

View 3 Replies

Web Forms :: Accessing Master Page Control From Class File?

Aug 27, 2010

i have to write this piece of code in almost 10 to 15 content pages. i am just wondering if i can class file as base class for my content pages and write this piece of code in that class.

[Code]....

can somebody guide me how to write the base class for this scenario?

View 6 Replies

Web Forms :: Accessing HttpResponse Page.Response From A Class Instead Of Cs File?

Oct 18, 2010

I have an issue with trying to create a Pdf file from my webpage. Basically, everythig involving creating the Pdf (using iTextSharp) is done, and I'm doing this as a File Stream (i.e, I'm saving the Pdf on local machine). Now what I'm trying to do is create it as a Memory Stream (i.e, open the Pdf from the browser). I was able to do this earlier when I wa still at the 1st version of the application, and all of the code behind was incluced in my .aspx.cs file. But now, I've kept the code in the .aspx.cs at a minimum and put the cude in classes and I'm creating onjects of thoses classes from the .aspx.cs

The problem is that the code from creating the Memory Stream is in a class as follows:

[Code]....

As you can imagine, the compiler cannot recognise "Response" as it's in a seperate class instead of in .aspx.cs

View 5 Replies

Accessing Master Page In Custom PageBase In App_Code?

May 26, 2010

I am tring to access a custom property on my Master page in a custom PageBase that resides in the App_Code folder. I can get this to work no problem in a web app but im having trouble doing it in the website project.

PageBase:

public abstract class PageBase : ClientSidePageBase
{
public WebMessage Message
{
get

[code]...

The above sample is what is in my web application and works fine but if i try and put this in the App_Code it doesnt pick up the MasterPage class so I cant access the property.

View 1 Replies

Static Class In App_Code?

Jan 8, 2010

If a static class is put in App_Code, does that imply only one instance will be created, shared by different http requests?Or each request still brings one request?

View 3 Replies

Get The URL Of The Current Page From Within A C# App_Code Class?

Oct 19, 2010

I have a logging class that, well, logs things. I would like to add the ability to automatically have the current page be logged with the messages. Is there a way to get the information I'm looking for?

View 4 Replies

Can't See Class Defined In App_Code VS2010?

Jun 25, 2010

I am using VS2010 and am creating an ASP.Net application.I have declared a class called "Calculator" in a class file called "Calculator.cs" in the App_Code folder.I have a form called "CalcDemo.aspx" with a code behind file. I try and use the "Calculator" class but intellisense can't see it. I thought App_Code is the common code repository for any classes I define and should be visible to all ASPX code behind files
The namespaces are the same like Webapp1.xxxx

View 2 Replies

Compileable Class-files In Another Dir Then The App_Code?

Apr 23, 2010

Is there anyway to actually have a class-file placed in any custom directory and still be able to compile it with the application?

View 4 Replies

Access Session / Cache From Class In App_code?

Feb 8, 2010

Is that possible to get access to Session, Cache, Server.MapPath() from a class in App_code?

View 1 Replies

Web Forms :: Putting Email Class In App_Code

Dec 6, 2010

I'm trying to set up a smart way to handle email in my ASP.NET Web Application Project. I created a class in my App_Code folder named "MailHelper.cs" but am having trouble invoking it in the code-behind pages. Can someone please correct me on the correct way to do this?Here's the Mail.Helper.cs file in App_Code:

[Code]....

How do I invoke this when I'm ready to fire off a message? Let's say I have a Submit_Click event and want an email to be generated:

[Code]....

View 3 Replies

CodeBehind Class Not Accessible To Code In App_Code Folder?

Jan 31, 2010

I have a PlannerShiftView user control in the root folder of my ASP.NET web site. In my App_Code folder, I have a ShiftViewTemplate class that needs to instantiate a PlannerShiftView (for a TemplateField in a GridView). The problem is, the following code doesn't compile because the PlannerShiftView type is not available in what I deem to be the App_Code 'phantom namespace'.

Please can somebody explain to be what is happening here, as well as what to do. I know I can just move the ShiftViewTemplate out of App_Code, going against convention and without explantion, but that is something of a hollow victory.

View 1 Replies

Get Page Title Inside Class In App_Code Folder

May 5, 2010

I guess I might be missing something easy (or not) here. I have a class in App_Code which do some validations over Session and Request.Url, till here it's working fine. But then I need to get the actual page title. I know it's simple to get it in the page's code behind, but could I get it in a separate class like it is on my scenario?

View 8 Replies

Architecture :: Access Class Files Not In App_Code Folder

Feb 25, 2010

I have a single project. and I have two folder in it. In the 1st folder I have a class named Class1 and in the 2nd folder I have a class named Class2. Can anyone tell me how I can access members of Class1 in Class2. I have tried by adding namespace in Class1 and Using that namespace in Class2. But it is giving error. It is easy to access classes or their members from App_Code folder. I don't want to put my classes in app_code folder.

View 3 Replies

Configuration :: Custom Class Inside App_code After Published?

Apr 6, 2010

I have some problem in app_code. I created one class name as class1 in side app_code.... Now I have a grid view with lots of textboxes inside it(itemtemplete). I call class1 to fill the all the values in my database with get set properties..... it working awesome on local. but problem is that after published it is not working.... I mean class1 is not called after publishing.... And app_code folder also not appearing at published folder.

View 5 Replies

State Management :: How To Use ViewState In Class Inside(App_code) Folder

Aug 23, 2010

i want to do some thing like this in in Class inside(App_code) folder i want to know how to do it with

Correct Syntax :
public static void GetViewStateValue(int StudentID,ViewState MyViewState)
{
if(MyViewState["Name"]!=null)
{
}
}

View 7 Replies

Localization :: Access Resource String From Class In App_Code Folder?

Mar 8, 2011

Or any class that's not X.aspx.vb. I've imported the Globalization, Threading, Threading.Thread, and UI.Page namespaces. But it won't come up in Intellisense and it gives error lines in my code. Is there a way to access use the GetLocalResource("Y") method in other classes?

View 3 Replies

Configuration :: Slow Load Time After Updating Class In App_Code?

Dec 20, 2010

We have an asp.net website running on IIS 6 Windows 2003. When ever we upload a class file to the App_Code folder our whole site goes down temporarily until, what I assume, compilation is complete. Has anyone else experienced this? Any other file we upload it does not do this only our class files.

View 1 Replies

Configuration :: CS0103 Error When Calling Class Contained In App_Code Folder

Nov 18, 2010

I have created a simple ASP.NET Website in Visual Studio 2008. I have a static C# class (lets call it someClass) contained in a separate file in the App_Code folder. I call a method from that class in my page's code behind like so:

someVar = someClass.someMethod(someParam);

This compiles correctly in VS 2008 but when I move it over to my IIS server, I get the following error (CS0103): Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0103: The name 'someClass' does not exist in the current context I have created a virtual directory for this website enabling 'Read', 'Run scripts (such ASP)', and 'Execute (such as ISAPI applications or CGI)'. I am not currently utilizing namespaces (as I thought I would not need to and I'm not sure how to use them properly). What am I doing wrong?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved