interviews.dotnetthread.com

↑ Grab this Headline Animator

Tuesday, August 26, 2008

Definition Of the Terms Used for the building of Asp.net application

1. AssemblyInfo.cs (file) - It consists of all of the build options for the project, including version, company name, GUID, compilers options....etc. AssemblyInfo.cs file is created automatically when you create a windows application by Microsoft Visual Studio 2005. It is located under the folder "Properties". AssemblyInfo.cs file also get created, when you create any Web Application project. It consists of various information about an assembly like title, description, configuration, company, product, copyright, trademark, culture, GUID, version and is controlled through a set of attributes.

2. Global.asax (file) - The Global.asax file, also known as the ASP.NET application file contains code for responding to application-level events raised by ASP.NET or by HttpModules. The Global.asax file resides in the root directory of an ASP.NET-based application. At run time, Global.asax is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplication base class. The Global.asax file itself is configured so that any direct URL request for it is automatically rejected; external users cannot download or view the code written within it.
Global.asax is a file used to declare application-level events and objects. Global.asax is the ASP.NET extension of the ASP Global.asa file. Code to handle application events (such as the start and end of an application) reside in Global.asax. Such event code cannot reside in the ASP.NET page or web service code itself, since during the start or end of the application, its code has not yet been loaded (or unloaded). Global.asax is also used to declare data that is available across different application requests or across different browser sessions. This process is known as application and session state management. The Global.asax file must reside in the IIS virtual root.

3. Web.config (file) -Web.config file is a configuration file for the Asp .net web application. An Asp .net application has one Web.config file which keeps the configurations required for the corresponding application. Web.config file is written in XML with specific tags having specific meanings. There are number of important settings that can be stored in the configuration file. Some of the most frequently used configurations, stored conveniently inside Web.config file are database connections, session states, error handling, security.
Web.config is the main settings and configuration file for an ASP.NET web application. The file is a text based XML document that defines such things as connection strings to any databases the application uses, the default language for child pages, whether debugging is allowed and how it can be implemented, whether Session State is used by default, what type of authentication is used, if any, and so on. Web.config files can only be placed inside directories that have been configured as ASP.NET applications such as the web application's root directory. Web.config files inherit properties from higher level .config files and ultimately machine.config however some settings inside machine.config cannot be overridden.

4. bin (folder) - We can store compiled assemblies in the Bin folder, and other code anywhere in the web application( such as code pages) automatically references it. A typical example is that you have the compiled code for a custom class. We can copy the compiled assembly to the Bin folder of our Web application and the class is then available to all pages. Assemblies in the folder do not need to be registered. The presence of a.dll file in the Bin folder is sufficient for ASP.NET to recognize it.
Source: http://msdn2.microsoft.com/en-us/library/t990ks23.aspx

5. App_Code (folder) - We can store source code in the App_Code folder, and it will be automatically compiled at run time. The resulting assembly is accessible to any other code in the Web application. The App_Code folder therefore works much like the Bin folder, except that you can store source code in it instead of compiled code. The App_Code folder and its special status in an ASP.NET Web application makes it possible to create custom classes and other source-code-only files and use them in your Web application without having to compile them independently.
The App_Code folder can contain source code files written as traditional class files — that is, files with a .vb extension, .cs extension, and so on
Source: http://msdn2.microsoft.com/en-us/library/t990ks23.aspx
6. App_Data (folder) - To improve the security of the data used by your ASP.NET application, a new folder named App_Data has been added for ASP.NET applications. Files stored in the App_Data folder are not returned in response to direct HTTP requests, which makes the App_Data folder the recommended location for data stored with your application, including .mdf (SQL Server Express Edition), .mdb (Microsoft Access), or XML files. Note that when using the App_Data folder to store your application data, the identity of your application has read and write permissions to the App_Data folder.

DEFINE THE FUNCTION OF THESE FILE TYPES:
1).aspx(Active Server Page Extended)- ASPX is a text file format used to create webform pages; in programming jargon, the ASPX file typically contains static HTML or XHTML markup, as well as markup defining Web Controls and Web User Controls where the developers place all the required static and dynamic content for the web page.
Additionally, dynamic code which runs on the server can be placed in a page within a block <% -- dynamic code -- %> which is similar to other web development technologies such as PHP, JSP, and ASP, but this practice is generally frowned upon by Microsoft except for the purposes of data binding since it requires more calls when rendering the page.
Server-generated Web page based on ActiveX scripting that uses the Microsoft ASP.NET framework; ASP code is first processed on the Web server and the resulting HTML code is sent to the user's Web browser.
2).aspx.cs- The method recommended by Microsoft for dealing with dynamic program code is to use the code-behind model, which places this code in a separate file or in a specially designated script tag. Code-behind files are typically named something to the effect of MyPage.aspx.cs or MyPage.aspx.vb based on the ASPX file name (this practice is automatic in Microsoft Visual Studio and other IDEs). When using this style of programming, the developer writes code to respond to different events, like the page being loaded, or a control being clicked, rather than a procedural walk through the document.
So, .aspx.cs is the code behind file for the .aspx file. This file contains all the code necessary to respond to different events that take place in the application.

3).cs-It is the extension for a C Sharp(C#) file. It is C# source code file placed in the App_Code folder which is dynamically compiled to be available to the whole application.
C# is a new object oriented programming languages developed by Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles