[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to open a .cs file

Posted on 2004-09-13
4
Medium Priority
?
1,981 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

829 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