473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

I cannot access class inside ASP.NET Web Application !

I cannot access class inside ASP.NET Web Application
a few seconds ago|LINK

Hello,

I start to created a new ASP.NET Web Application with VS 2005.

I created a sperate folder called "Classes" where I created my first class "CContact".

Then, I added a page "default.aspx" in order to display First name & Last name.

Unfortunately, I cannot access the class "CContact in the Page_Load() method when I try to type the following code: MyWebApp. ... The only class that i can see is "_Default"

What i'm doing wrong ?

Can anyone help me ?

Thank you

Paul


Expand|Select|Wrap|Line Numbers
  1. // -----------------------------------------------------------
  2. // Class: CContact.cs
  3. // -----------------------------------------------------------
  4. using System;
  5. using System.Data;
  6. using System.Configuration;
  7. using System.Web;
  8. using System.Web.Security;
  9. using System.Web.UI;
  10. using System.Web.UI.WebControls;
  11. using System.Web.UI.WebControls.WebParts;
  12. using System.Web.UI.HtmlControls;
  13.  
  14. namespace MyWebApp
  15. {
  16.     public class CContact
  17.     {
  18.  
  19.         // Constructor
  20.         public CContact()
  21.         {
  22.  
  23.         }
  24.  
  25.         public static string FirstName()
  26.         {
  27.             return "John";
  28.         }
  29.  
  30.         public static string LastName()
  31.         {
  32.             return "Travolta";
  33.         }
  34.  
  35.     }
  36. }
  37.  
  38.  
  39.  
  40. // -----------------------------------------------------------
  41. // ASP.Net Page: default.aspx.cs
  42. // -----------------------------------------------------------
  43. using System;
  44. using System.Data;
  45. using System.Configuration;
  46. using System.Collections;
  47. using System.Web;
  48. using System.Web.Security;
  49. using System.Web.UI;
  50. using System.Web.UI.WebControls;
  51. using System.Web.UI.WebControls.WebParts;
  52. using System.Web.UI.HtmlControls;
  53.  
  54. using MyWebApp;
  55.  
  56. namespace MyWebApp
  57. {
  58.     public partial class _Default : System.Web.UI.Page
  59.     {
  60.         protected void Page_Load(object sender, EventArgs e)
  61.         {
  62.  
  63.         }
  64.     }
  65. }
  66.  
Mar 7 '12 #1
0 1374

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Thomas Barnet-Lamb | last post by:
I was wondering if anyone could give me some help with the following. Consider the code snippet: struct qqq{typedef qqq* pointer;}; template<class al> struct foo : public al { template...
6
by: Grant | last post by:
Hi, I'm trying to setup a web server to host asp.net 1.1... but keep getting the following error message: Hopefully someone can give me some ideas on what I may need to do. Thanks in...
3
by: Tracey | last post by:
sorry I post this problem again. I have to stop my work to fix the problem. I'm doing a multi form application(Not a MDI one). My startup form say Form1 has a datagrid say datagrid1, when I...
1
by: Daves | last post by:
I have a custom (derived) Page class called BasePage where I define a class called ImgLink and it has a public constructor: public class ImgLink{ publicImgLink(params...)} From the Masterpage...
2
by: wikkiwikkiwaa | last post by:
hello, i am trying to access controls inside my formview1 nested inside loginview1. you cannot access the formview1 unless you are properly logged in. for loginview1, that seems to be fairly...
2
by: yogeshbhandare | last post by:
Is there any special reason that we cannot define a class inside a function We can instantiate a class inside a function but not define ? What could be the cause of such a behavior? We can define...
0
by: sdanda | last post by:
Hai i am working on vb.net. In my application I created four forms.Those are first.vb,f1.vb,f2.vb and f3.vb In firstvb I added 3 checkboxes and a "display" button.The 3 checkboxes are used to...
3
blazedaces
by: blazedaces | last post by:
Hello, it's been a while since I posted on these forums. My issue I think isn't as much in my code as it's in the syntax and structure in references other packages. I'll get straight to it then: ...
1
by: Robert Jabbour | last post by:
Hi I have server 2003 std and I'm using Homingbeacon changeip software and my server stand behind a netgear router, my problem is that I can only access my server remotly ( If I put remotly the Ip...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.