?
Solved

how to open a .cs file

Posted on 2004-09-13
4
Medium Priority
?
1,978 Views
Last Modified: 2010-05-18
How do I open a .cs file?

The code looks like C# asp.net


Thanks.
0
Comment
Question by:duckers1234567890
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 10

Expert Comment

by:jnhorst
ID: 12051852
That's what it likely is.  You can view it using any text editor as it ASCII text.  If you have Visual Studio you can use that too.  Just note that if you change it, the project has to be recompiled for any changes to be applied.  The .cs files are compiled into a dll file usually in a bin folder of an asp.net application.

John
0
 

Author Comment

by:duckers1234567890
ID: 12051863
how do I run it?  In a web browser? or called upon as an include?

Thanks.
0
 
LVL 10

Accepted Solution

by:
jnhorst earned 220 total points
ID: 12051921
You don't really "run" it.  When you create an aspx page, Visual Studio creates the .cs file as what is called "codebehind".  It is an object-oriented representation of the page.  When you compile the application, the classes defined in the .cs files all get compiled up into what is called a "namespace".  If you look at an aspx page, the very first line (usually) has what is called a Page Directive.  In that element is an attribute like this: Inherits="namespace.pageclass".  SO if I had an application named WebApp1 and a page in this app called start.aspx, this would be Inherits="WebApp1.start".

When a user requests start.aspx, that element tells the asp.net runtime running under IIS to try to instantiate the "start" class in the WebApp1 namespace that is all defined in the dill file for the app, which is created when the app is compiled.  In fact, when a developer creates a site on a development machine, the .cs files should not be copied onto the server, as when the app is actually run, they are not used, not even as includes.

John
0
 
LVL 10

Expert Comment

by:jnhorst
ID: 12051926
Question: are these files like this: "start.aspx.cs" ("start" could be any filename).

John
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question