Solved

how to open a .cs file

Posted on 2004-09-13
4
1,968 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
  • 3
4 Comments
 
LVL 10

Expert Comment

by:jnhorst
Comment Utility
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
Comment Utility
how do I run it?  In a web browser? or called upon as an include?

Thanks.
0
 
LVL 10

Accepted Solution

by:
jnhorst earned 55 total points
Comment Utility
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
Comment Utility
Question: are these files like this: "start.aspx.cs" ("start" could be any filename).

John
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now