.aspx and .aspx.cs files

When you add a new web page to your website you should notice the following important things

1)    The extension of your web page is .aspx. All the web pages you will be adding to the asp.net website will have this extension.
2)    On adding a web page to your website two files got created. One of the files has extension .aspx and the other file has an extension .aspx.cs. Look at the screenshot below

.aspx and .aspx.cs files in asp.net
3)    The .aspx file is called the web page and the .aspx.cs file is called the code behind file for this web page. Every page you will add to your website will have its own code behind file with .aspx.cs extension.

4)    All the UI related markup for your web page will be in your .aspx file and all the code that you will be writing in C# will be written in the .aspx.cs file

5)    If you have chosen vb.net as your programming language to work with asp.net then the extension of the code behind file will be .aspx.vb

If you open your .aspx.cs file you will see that it contains a C# class which inherits itself from System.Web.UI.Page class.

.aspx.cs file in asp.net

Now if you open your .aspx file and read the first line you will see how it connects itself with the .aspx.cs file by naming it as its code behind file

.aspx file
You will learn about both these files in details in the coming tutorials.

Quick Links



Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..


Login to Open ESchool OR Create your account    Login   SignUp