Web Forms :: Unable To Create Shared Classes In The Website

Jul 9, 2010

Whenever I create a new folder in my website (VS008) and add an item (Class) it can't be seen by the other pages, even though new class is public. Only if I add the class to the app_code folder or create a bin folder for it then it could be shared from these folders however I want to create my own custom named folders for organization and keep my classes there.

View 2 Replies


Similar Messages:

Unable To Access Classes From Different Files In VB.NET Website?

Jun 9, 2010

I've inherited a VB.NET website and it won't compile because the class1 in the file class1.vb refers to class2 in a file called class2.vb. I get the following error when trying to compile: Type Class2 is not defined.

When I look in the object browser the classes are listed separately (i.e. not all grouped under the same namespace) and appear as:

Public Class Class
Inherits System.Object
Member of C:...mywebsite [code]....

View 2 Replies

Web Forms :: Shared Functions And Classes Error

Oct 4, 2010

I have some code in my new asp.net app that I need to share. So i created a shared class called
"utilities.vb" and put it in the APP_CODE folder. There is a function I have in there that pulls a person's image based off of their MemberId.

[Code]....

And I can call this function from my page using utilities.FcnGetMemberImage(). Ok, so all good so far until it complains about...

"Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class"

when referring to the Server.MapPath()

But the problem is that if I don't make it a Shared Function, I can't access it from my other pages. But if I do make it a Shared Function, it throws this error. The fix is supposed to be that I either don't share the function, or

"add the shared keyword to the member declaration", according to Microsoft at
http://msdn.microsoft.com/en-us/library/xfsswe45.aspx

But I'm not exactly sure how to "add the shared keyword to the member declaration" or what this means exactly and how this might affect other parts of my code?

Or is there a better way to work around this dilemma?

View 3 Replies

Could/Should Use Static Classes In C# For Shared Data?

May 7, 2010

I'm building an online system to be used by school groups. Only one school can log into the system at any one time, and from that school you'll get about 13 users. They then proceed into a educational application in which they have to co-operate to complete tasks, and from a code point of view, sharing variables all over the place.

I was thinking, if I set up a static class with static properties that hold the variables that are required to be shared, this could save me having to store/access the variables in/from a database, as long as the static variables are all properly initialized when the application starts and cleaned up at the end. Of course I would also have to put locks on the get and set methods to make the variables thread safe.

Something in the back of my mind is telling me this might be a terrible way of going about things, but I'm not sure exactly why, so if people could give me their thoughts for or against using a static class in this situation,

View 1 Replies

How Are Classes Shared Between Projects In The Same Solution

Jan 29, 2011

I'm totally new to the Microsoft dev scene so please go easy :)Currently, I have a solution that contains two projects (ASP.net websites, FWIW). If I create a class in Project1, how do I expose it to Project2? Is it automatically available to Project2 because they are in the same solution? Or do I need to do something special to make the connection?

View 5 Replies

How To Get Classes To Expose The Same Shared / Static Method

Mar 4, 2010

I have a base class with several derived classes. I want all of my derived classes to have the same Public Shared (static) method with their own implementation. How do I do this?

View 3 Replies

Visual Studio :: Add Shared Classes / Files Into Project

Feb 20, 2011

VWD 2010 Express.

We have shared CSharp classes put into a shared folders for re-use. Now I want to add those classes into my project by creating a new folder:

1) Right click the solution,
Add -> New Folder
Give it a new, eg. SharedClasses

2) Right click the new folder "SharedClasses"
Add- > Existing Item...

Browse to the "Shared Folder", include those shared classes. But those files are added physically into the folder "SharedClasses" rather than a reference. How do I just add a link to those shared files? Since these files might be modified from time to time, I don't want to delete and add those file frequently.

View 3 Replies

Visual Studio :: Unable To Create .net Website (VS 2008)?

Jan 17, 2010

Even After successfull installtion of ASP.Net, I am not able to create ASP.net website.

It gives me error in image.I tried giving permissions to my account but no use.

Comp mgmt event log shows:
=============================================
Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1334
Date: 1/17/2010
Time: 11:53:34 AM
User: N/A
Computer: SUMEET-3019DBCB
Description:
Failed to initialize the AppDomain:3ebaf6e5

Exception: System.NullReferenceException

Message: Object reference not set to an instance of an object.

StackTrace: at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)

View 6 Replies

Web Forms :: Unable To Get The Label Text Into Public Shared Function

Jan 12, 2010

I am using the following code for slide show of AjaxToolkit. It works. But I wanna get the label1.text as picture name But I cannot do it in public shared function ! How can I do that !

[Code]....

View 6 Replies

State Management :: Unable To Create A Persistent Cookie To Store A Preferred Language On Website

Feb 10, 2011

I try to create a persistent cookie to store a preferred language on our website, but it doesn't work.

So, to isolate the problem, I created a new website, with a blank page and with the code behind bellow. If I click the button, the page post back and I get this:

"Cookies expires: 0001-01-01 00:00:00 value: 10"

[Code]....

View 5 Replies

Private Shared Vs Public Shared Vs Protected Shared

Jan 5, 2010

let me know what does these access modifiers means.private shared vs public shared vs protected shared

View 5 Replies

Unable To Access SQL Reporting Services On Shared Site With Themes Enabled

Jun 1, 2010

I am having some trouble with my IIS web server & SQL reporting services.

At the current time my site is playing host to both reporting services (/reports & /reportserver) as well as my personal website (domain.com)

Only just recently have I implemented a Theme on my site and as such I have placed a statement in my web.config file directing it to apply a certain theme in the following manner:

<pages styleSheetTheme="General">

Because of this when I try to access the report pages it fails, telling me it couldn't find the Theme. So, what I did was locate the source files for the /reports & /reportserver directories and placed the App_Theme folder in them hoping that would sort everything out.

What I am getting now is the following error:

*Using themed css files requires a header control on the page. e.g. head runat="server" *

Does anyone know how I can get around this? Do I have to hack the SQL reporting aspx pages? I do NOT want to remove the web.config declaration.

View 2 Replies

IIS Configuration :: Unable To Connect To SQL Server Database Hosted In Shared Hosting

May 27, 2013

i have database that is stored on local.user should also be able to upload the database to online server . i am able to save it on local .But it is not saving on server.It shows request time out. Is it due to server not allowing external access.

View 1 Replies

WCF / ASMX :: Unable To Get Classes Inside Webservice In Class Library

Jan 28, 2011

I am not able to get classes inside web service in class library.

View 3 Replies

Setting Up A Website App On The Shared Network?

Mar 28, 2011

I setup the project on the network instead of localhost? I want to setup a Remote Site, I think is the lingo Go into visual studio File, open website and put the website name in the box and a password to open the source.Create a unique url name like myWebApp.mycompany.com

When I create a new website application in visual studio. When I am ready to debug Visual Studio sets all this up for me and it runs on local host automatically.I guess in my scenario I gotta set it up manually. How do I accomplish this?I created a new virtual directory, went through the permissions wizard and keep getting this error:

Failed to access IIS metabase.

View 2 Replies

Visual Studio :: Unable Access To Classes From Other Folders Out Side Project Files

Jan 24, 2010

im facing problem to access classes out side my project folders. for example if i want to use some methods from store.vb file inside my project i get error : Name Space is not defiend, i have tried all ways such as import sdf.ITracjer.Data

[Code]....

i can't fetch the Store Class Methods or Function because its out of project directory, as its showin in image.

View 3 Replies

How To Create Shared Views In MVC

Jan 20, 2011

In my Views folder I have a several folders such as Category, Origin, Price. They all have a Browse.aspx file and the code in this file displays a table of products. All controllers associated with these folders use the same ViewModel, but in each view I have a repetitive code. The code is:

Folder Category, file browse.aspx
Folder Origin, file browse.aspx
.....

<% foreach ( var p in Model.Products) { %>
<li> <%: p.productname + " " + p.price + " " + p.origin.originname + " " + p.category.categoryname %> </li>
<% } %>

How can I create a shared view and use the shared view in all these views?

View 1 Replies

C# - Sending Bulk Emails From Website Through Shared Hosting?

Jul 1, 2010

I am using gmail server settings to send emails for my asp.net website. Since there is a limitation on number of mails sent per day and limitations on sending to number of users, I cant use this service for long. Even If I use an idea to make sure I use multiple id's to send thousands of emails it will still not work.

I am taking care of all norms of subscribe and unsubscribe options, so that only registered users will receive mails.

I need to build a system which send mails accross thousands of emails * thousands of users per day. . I think this is possible, as emailers in twitter,facebook, orkut, linkeden work on same basis. Many of them use MailChimp Email Service.

But I am hosting my website on shared hosting (www.crystaltech.com) rather than dedicated server (Host Provider suggested me to go to dedicated server for my mail requirement). This host provider charges a lot to me if I include a dll, so I am not able to use dll. Is there any I can send bulk emails without using a dedicated server or dll.(Will use it in only in worst case scenario).My host providers said that they will be able to give service of sending only 800 mails per day. Are there any api providers for that. I have already checked with [URL]

View 2 Replies

How To Read RSS Feeds And Display It On Website Using Syndication Classes In .net 4.0

Mar 25, 2011

I've tried to read and display the following RSS feed:

[URL]

on my website using Syndication Classes but so far it does not work.

I've created two labels Label1, and Label 2 as well as one DataList in my asp web page, then I have tried to use XMLReader to read the feed but I think XMLReader can only read RSS feeds created in XMLWriter if I am correct.

I think the feed I am trying to read was not created in XML writer and there are some formatting issues. What is the best way to complete my task if I am not sure about the way the RSS feed was created?

I've tried the followign link for the reference but with not much success:

[URL]

View 6 Replies

Create A New App - Refactor The Classes Out Of The Desktop App?

Aug 5, 2010

I'm about to embark upon learning how to create a web site(in fact I am about to create a website for our company) which will enable users to place an order on our system. I already have a desktop, C# WPF, application that has some of the classes I am going to require in the MVC architecture of this new website. Can anyone advise me of the best practise to reuse these classes in the website. If I was going to create a new app I would refactor the classes out of the desktop app into a class library then add this to my new app by adding an existing project (my class library) to my solution but that option does not seem to exist in creating a website?

View 7 Replies

Create Classes To Represent One To Many Relationships In C#?

Jun 20, 2010

how to create C# classes to represent one to many relationships in C#. I have a Customer and an Address table in my database. I also have a Customer class in my C# solution but how do I introduce the multiple address element? Do I have a separate Address class? Do I create a subclass in the Customer class or create a method in Customer called GetAddresses of type List which contains all of the relevant logic? In my code I need to be able to return a customer with all associated addresses and I just cannot picture the best way to achieve this using OOP.

View 9 Replies

Architecture :: How To Create Wrapper Classes

Nov 24, 2010

I have a third party dll and i need to add some more functionalities (methods, constants etc..) so create a wrapper class. I have no idea about wrapper classes. what is the purpose of this and how to create in .NET for this 3rd party dll.

View 6 Replies

MVC :: Create The Models Classes All The Time ?

Jan 7, 2011

Do I need to create the Models classes all the time ?

such as

[Code]....

I would like to use the classes straightly ,that is generated by Linq to sql?

View 1 Replies

Web Forms :: Using C# Classes Vb Classes Together In VS2008 / 3.5 Project

Mar 24, 2010

Can I use VB and C# classes together in the same asp.net 3.5 project?

View 3 Replies

How To Create Multiple Classes In Single DTO Class

Dec 1, 2010

I am used to making separate Business Object and List<> classes for my DB tables. Sometimes I just have a basic task in hand as displaying a list of year for a search box or having some values in a drop down.

Right now I am ending up with a lot of separate classes and List classes<> for these basic operations.

How can I make a single class for some basic tasks as these by using generics? I want to have single class for some methods like get current year, employee names, Department Name/Code, Title etc. I am using .NET 2.0.

Edit
After some searching, I found that I can achieve similar tasks by creating a DTO namespace.

What I don't get right now is how to create multiple classes inside my DTO class. Say 1 class for just returning 'year', One for 'Employee Name/Code' and so on inside the single DTO class.

View 1 Replies







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