MVC :: Adding A Class To A Project?

Mar 26, 2011

I have created an App_Code folder in my MVC 2 project and added a C# Class to it. In my Controller I have added a using reference to the namespace my class is in so that i can create an instance. However when I run the project it says there is a build error and that the namespace could not be found or doesn't exist. I have added a namespace to the <pages><namespaces> part of the config file and that didn't fix it.

View 1 Replies

Similar Messages:

VS 2008 Adding Css File To Class Library Project?

Jan 10, 2011

I have a custom gridview control which is a class library project.I want to be able to specify the css class for the gridview which I can do.But I also want to set a default css stylesheet to the gridview. So if I don't override it using the cssclass property it must get it's cssclass from the default stylesheet I have in my project.

How can I specify the default stylesheet. I have a stylesheet in a folder called "Styles" in my project.

View 4 Replies

Using A VB Class From The Same Web Site Project In A C# Class?

Jul 23, 2010

I have an ASP.NET web site project where I am using both VB.Net and C# class files. I have included separate sub folders in the App_Code directory for classes of each language.However, while I can successfully make use of a C# class in a VB class, I cannot do the opposite: use a a VB class in a C# class.

So, to illustrate, I might have two classes such as this:

Public Class VBTestClass
Public Sub New()
End Sub [code]....

I get an error that "the type or namespace "VBTestClass" could not be found". What am I missing here?

View 2 Replies

MVC :: Adding Test Project?

Mar 15, 2011

When I first created the project. Visual studio 2010 gave me an option to create the test project, but I selected "No". Now i want to add teh Test project. Is theor any way, I can add the Test project later.

View 2 Replies

Adding Assembly Reference To Web Project?

Jul 7, 2010

Before using any class in your website project/page we have to add it's assembly reference to our project. Right?

Now, when I am using SmtpClient class from System.Net assembly after adding the System.Net.Mail namespace in namespace node of application's web.config file but without adding assembly reference to the project it still accepting and running the code. Why?

I enquired the machine's web.config file located at C:WINDOWSMicrosoft.NETFrameworkv2.0.50727CONFIG but didnt find any assembly reference for System.Net.

how it is working and where the assembly reference has been added and how?

View 4 Replies

How To Add C Sharp Class File To Project

Jul 25, 2010

My project is completely built on with codebehind, is it possible to add a class library .cs file to my project. since it is based on c sharp will i be able to add it.

View 2 Replies

How To Create The Class In The Web Root For The Project

Mar 20, 2010

I have a bit of code I am reusing on a lot of my pages so decided to put this code into a Class and placed this class inside the App_Code directory. However when ever I try and create an instance of tis class so that I can use it's Methods etc I can't seem to get it to work, but if I create the class in the web root for the project it all wrks as expected.

View 12 Replies

How To Use Web Class Library From A Windows Project

Feb 19, 2011

I have a Web project in which I defined some methods to parse some webpages. I then save the retrieved data in a DB. Now I have run a lengthy operation(it may take 2 days) in which I continously parse webpage this way.

Can I use the webproject from a Windows project. If I try to add a refference to it it doesn't work. How should I do it? I have used until now an application, and done the calls to the parsing methods in the pageLoad event but after an hour or so the process stops.

View 1 Replies

How To Use Server.HtmlEncode In Class Project In C#

Jun 14, 2010

how can I use this in class project c#

Server.HtmlEncode ?

View 1 Replies

Access Class File In Web Project?

Jan 29, 2010

I have a created a solution using visual studio 2008 and added a new project namely "test".

In this project i added a folder namely "code" and in this folder i added a class file "class1.vb".

But i am facinng problem when i am going to create object of that class1.vb in default.aspx.vb page

i want to access my class1.vb methods.

View 4 Replies

Visual Studio :: Adding A Reference To A Project?

Apr 13, 2010

1. Is there a reason why someone would want to add a reference to an assembly (e.g. System.Drawing) but not add the Using statement? Seems that if you add a reference, you should add the Using statement automatically, but maybe not always?

2. Correct me if I'm wrong, the only benefit of adding a "Using" statement at the top of your file, is to bring into scope an assembly and not have to fully type the class name? So if I have a Using System.Drawing, I can type in
string = Color.Tomato.ToString(); instead of string = System.Drawing.Color.Tomato.ToString();

View 3 Replies

Security :: Adding Existing Membership To A Project?

Mar 6, 2010

I have DB (my.mdf ) with already created membership (aspnet_db tables). There are defined roles and users.

I would like to integrate it in my project.

I dropped *.mdf into App_Data folder. When I open configuration (under menu Project) I can't see neither User nor Roles.

What step am I missing?

View 2 Replies

Adding C# User Control To Existing Project?

Mar 11, 2010

I've got an existing project written in Another person has written a user control in c#.

the steps for adding that C# user control to the app?

I've tried copying them to the folder and using "Add existing item", however it doesn't compile the code behind at all.

View 3 Replies

VS 2010 - Adding Datalist Control In Project

Mar 19, 2012

I add a DataList control in my project.. in the datalist, i put a image template.. it works when write the code.. The problem now is i cannot adjust the location of the image inside the datalist like its Left and Top..

View 1 Replies

How To Modify Published Project - Adding New Pages

Dec 12, 2012

I published a project called TestSample which has 2 pages page1.aspx and page2.aspx and application dll Test.dll in bin folder.

what i need is, i want to create a new page called page3.aspx and page3.aspx.cs through programmatically which is done by file stream object, my need is to publish this page3.aspx to the TestSample virtual directory and also page3.aspx.cs has to be merged with Test.dll so that code behind should be avoided.

View 1 Replies

C# - Project Is Not Recognising One Of The Folders In Class Library?

May 27, 2010

I am developing a project using Visual Studio 2008 in C#, I have added the class library within the project and set up the relevant references and used the relevant using statements.

this is the error message:

Error 28 The type or namespace name
'Domain' does not exist in the
namespace 'Forestry.SchoolLibrary'
(are you missing an assembly
reference?) C:ProjectsSchoolofForestry runkSourceSchoolAccountPresenterEditAccountPresenter.cs 26 40 School

these are my using statements:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Data.Linq;
using System.Text;
using System.Xml;
using Forestry.SchoolLibrary.Core.Domain;
using Forestry.SchoolLibrary.Properties;

View 2 Replies

Referencing Page Class In Project Subfolders?

Jan 28, 2010

I have a referencing problem in my project. I have an ASP.NET application where pages are in multiple subfolders. All pages user controls are working fine.

I just want to reference a page class that is not in the root folder (in subfolder from the root folder) in my usercontrol code-behind file like this

if (Page is ar_default){ //}Where ar_default is my page class name as it is in folder name "ar"The user control is also in the same subfolder as the page being accessed.Wnen I use the same method with pages in the root folder, there is no problem at all and it is working although I notice that the classes still not appearing in the coding drop down menu but if I typed the name correctly it so:if (Page is _default){ //}When using the same code with classes in subfolders it is giving this error:The type or namespace name 'ar_default' could not be found (are you missing a using directive or an assembly reference?)I'm not using any namespaces also.

View 4 Replies

How To Use Request And Response.redirect In Class Project In C#

Jun 13, 2010

I am unable to use request and response.redirect in class project in c# ! am I missing a refference ??

View 13 Replies

Web Forms :: Web Project With User Controls And Class Only?

Oct 7, 2010

i created a web project and add some class and user controls (ASCX files). then i build it and from the generated DLL file.

i add it (DLL file) to my actual web application and called the classes that i have made everthing works fine.

so the problem is the web user control, i don't know how can i use it. i know that it must be place to the aspx file but how?

View 2 Replies

C# - How To Add A Reference To A Web Application Project In An Associated Class Library

May 13, 2010

I'm working on an internet application that has been set up as a web SITE project (I know...) in Visual Studio. I need to add additional features/functionality so have added a class library to the project and referred to it in the main web site project.

The issue now arises because I need to make use of core objects which live inside the App_Code directory in the web site project but this project doesn't appear to expose its DLL like web app/ code library projects do. Because of this I can't add a reference to the web site project in the class library to leverage the common site-wide code/objects.

I can't move the stuff out of App_Code so I'm looking for a way to refer to the website project dll from the new class library.

View 3 Replies

C# - How To Determine Which Page Opened A Class In Another Project

Sep 13, 2010

I use a separate project for my data layer and call one class within it clsData.cs. I'd like to know which page from the Presentation Layer (in another project within the solution) has referenced it from the clsData side, if that's possible.

View 3 Replies - Moving Functionality To A Class Library Project ?

Mar 30, 2011

I have a .net project whose part of the functionality is xls transformation. I now want to move that functionality away from the main project to a separate class library project.

I have no problems moving classes and accessing them, but part of the resources that I wanted to move were xslt files that define the transformations. Those files were originally located in the special folder: App_Data and then accessed using Server.MapPath(~/App_Data/XSLT/anXsltFile.xslt)

I wanted to move those files to that separate library as well, but not sure how to approach it, and how to access those files within the class library.

View 4 Replies

WCF / ASMX :: Use Webservice In Class Library Project?

Oct 3, 2010

I've created class library project and added service reference to webservice. When i try to use webservice object am not able to access webservice methods.

myservice proxy=new myservice();
proxy.( no methods are coming)?

View 2 Replies

Unable To See Master Pages While Adding A Page In The Project

Feb 25, 2011

I am trying to add a .aspx page in the project , but while adding the .aspx page i am not getting the option to choose existing master pages. I remember long back i used to get that option to select the master page.

View 2 Replies

Web Forms :: Invoke C# Function From Another Project Without Adding Reference?

Sep 24, 2010

There is a libraray project whose dll name is customer.dll. It has a class name customer with a function name show(). I want to call this function from another project but dont want to add reference to the caller project. Can this be done? Is there any class that can acheive this?

View 1 Replies

Copyrights 2005-15, All rights reserved