You are on page 1of 92

Question 1: What is ASP.NET?

Answer: ASP.NET was developed in direct response to the problems that developers had with
classic ASP. Since ASP is in such wide use, however, Microsoft ensured that ASP scripts execute
without modification on a machine with the .NET Framework (the ASP engine, ASP.DLL, is not
modified when installing the .NET Framework). Thus, IIS can house both ASP and ASP.NET scripts
on the same machine.

Advantages of ASP.NET

1. Separation of Code from HTML:

To make a clean sweep, with ASP.NET you have the ability to completely separate layout
and business logic. This makes it much easier for teams of programmers and designers to
collaborate efficiently.

2. Support for compiled languages:

Developer can use VB.NET and access features such as strong typing and object-oriented
programming. Using compiled languages also means that ASP.NET pages do not suffer the
performance penalties associated with interpreted code. ASP.NET pages are precompiled to
byte-code and Just In Time (JIT) compiled when first requested. Subsequent requests are
directed to the fully compiled code, which is cached until the source changes.

3. Use services provided by the .NET Framework:

The .NET Framework provides class libraries that can be used by your application. Some of
the key classes help you with input/output, access to operating system services, data
access, or even debugging. We will go into more detail on some of them in this module.

4. Graphical Development Environment:

Visual Studio .NET provides a very rich development environment for web developers. You
can drag and drop controls and set properties the way you do in Visual Basic 6. And you
have full IntelliSense support, not only for your code, but also for HTML and XML.

5. State management:

To refer to the problems mentioned before, ASP.NET provides solutions for session and
application state management. State information can, for example, be kept in memory or
stored in a database. It can be shared across web farms, and state information can be
recovered, even if the server fails or the connection breaks down.

6. Update files while the server is running:

Components of your application can be updated while the server is online and clients are
connected. The framework will use the new files as soon as they are copied to the
application. Removed or old files that are still in use are kept in memory until the clients have

7. XML-Based Configuration Files:

Configuration settings in ASP.NET are stored in XML files that you can easily read and edit.
You can also easily copy these to another server, along with the other files that comprise
your application.

ASP.NET Overview

Here are some points that give the quick overview of ASP.NET.

 ASP.NET provides services to allow the creation, deployment, and execution of Web
Applications and Web Services.

 Like ASP, ASP.NET is a server-side technology.

 Web Applications are built using Web Forms. ASP.NET comes with built-in Web Forms
controls, which are responsible for generating the user interface. They mirror typical HTML
widgets like text boxes or buttons. If these controls do not fit your needs, you are free to
create your own user controls.

 Web Forms are designed to make building web-based applications as easy as building
Visual Basic applications.

For further information click on the link:

 Introduction to ASP.NET

Question 2: What are the different validators in ASP.NET?
Answer: ASP.NET validation controls define an important role in validating the user input data.
Whenever the user gives the input, it must always be validated before sending it across to various
layers of an application. If we get the user input with validation, then chances are that we are
sending the wrong data. So, validation is a good idea to do whenever we are taking input from the

There are the following two types of validation in ASP.NET:

 Client-Side Validation
 Server-Side Validation

Client-Side Validation:

When validation is done on the client browser, then it is known as Client-Side Validation. We use
JavaScript to do the Client-Side Validation.

Server-Side Validation:

When validation occurs on the server, then it is known as Server-Side Validation. Server-Side
Validation is a secure form of validation. The main advantage of Server-Side Validation is if the user
somehow bypasses the Client-Side Validation, we can still catch the problem on server-side.

The following are the Validation Controls in ASP.NET:

 RequiredFieldValidator Control
 CompareValidator Control
 RangeValidator Control
 RegularExpressionValidator Control
 CustomFieldValidator Control
 ValidationSummary

For further information click on the link:

 Validation Controls in ASP.Net

Question 3: What is View State?
Answer: View State is the method to preserve the Value of the Page and Controls between round
trips. It is a Page-Level State Management technique. View State is turned on by default and
normally serializes the data in every control on the page regardless of whether it is actually used
during a post-back.

A web application is stateless. That means that a new instance of a page is created every time when
we make a request to the server to get the page and after the round trip our page has been lost

Features of View State

These are the main features of view state:

1. Retains the value of the Control after post-back without using a session.
2. Stores the value of Pages and Control Properties defined in the page.
3. Creates a custom View State Provider that lets you store View State Information in a SQL
Server Database or in another data store.

Advantages of View State

1. Easy to Implement.
2. No server resources are required: The View State is contained in a structure within the page
3. Enhanced security features: It can be encoded and compressed or Unicode implementation.

For further information click on the link:

 What is View State and How it Works in ASP.NET

Question 4: What are the different Session state management options
available in ASP.NET?
Answer: State Management in ASP.NET

 A new instance of the Web page class is created each time the page is posted to the server.

These options can be broadly divided into the following two categories: o Client-Side State Management Options o Server-Side State Management Options Client-Side State Management  Client-based options involve storing information either in the page or on the client computer.  The Microsoft ASP.  Server-side state management enables you to manage application-related and session- related information on the server.  In traditional Web programming.NET provides the following options to manage state at the server side: o Application state o Session state . all information that is associated with the page.NET framework includes several options to help you preserve data on both a per-page basis and an application-wide basis. would be lost with each roundtrip. along with the controls on the page.  ASP.  Some client-based state management options are: o Hidden fields o View state o Cookies o Query strings Server-Side State Management  There are situations where you need to store the state information on the server side.

NET.Net Question 5: What is caching in ASP. you can run any web application by applying the caching concept depending on the requirements. admin needs to recreate the pages often depending on user requests…STOP!!! "A cache simply stores the output generated by a page in the memory and this saved output (cache) will serve us (users) in the future. Types .NET? Answer: Caching is one of the most interesting concept and operation in ASP.". Caching is for providing solutions or the results to the users depending on their request. If you can handle it.For further information click on the link:  State Management in ASP.

A page theme is applied to a single page of the web site.Net Question 6: How can we apply themes in ASP.NET controls. and other resources inside the subfolder of the App_Theme folder in the Solution Explorer window.NET application? Answer: A theme is a collection of settings that define the look of controls and web pages. and graphics. This theme allows us to maintain all the websites on the same web server and define the same style for all the web pages of the web sites. Themes are included images and skin files.For further information click on the link:  Caching in ASP. . the skin files set the visual properties of ASP. These themes are applied across all the pages in a web application to maintain a consistent appearance. style sheets. graphic files. Global Theme A Global theme is a theme that is applied to all the web sites on a web server and includes property settings. Themes are of two types: Page Theme A Page theme contains the control skins.

NET Question 7: What is MVC? Answer: Model-View-Controller (MVC) is a pattern to separate an application into the following three main components: 1. Model 2. Controller . View 3.For further information click on the link:  Creating Web Application Using Themes in ASP.

Basically cookies are a small text file sent by the web server and saved by the Web Browser on the client's machine.Net MVC Question 8: What are Cookies in ASP.  By default support of Facebook and Google Authentication.  It easy to manage a large application to divide in multiple areas. Domain: Using these properties we can set the domain of the cookie.NET MVC Framework is a lightweight. List of properties containing the HttpCookies Class: 1. For further information click on the link:  Getting Started With ASP.The ASP.Web.  It does not use view state or server-based forms. The MVC framework is defined in the System. highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP. Browser Cookies. It provides full control over HTML.  It works well for Web applications that are supported by large teams of developers and for web designers who need a high degree of control over the application behaviour. The ASP. .Mvc assembly. JavaScript and CSS.  It provides better support for Test-Driven Development (TDD). Expires: This property sets the Expiration time of the cookies.  Full control over HTML. such as HTTP Cookies. Session Cookies and so on. 2. Cookies are also known by many names. Cookies can store user-specific Information on the client's machine like when the user last visited your site.NET? Answer: Cookies are a State Management Technique that can store the values of control after a post-back. Web Cookies. such as master pages and membership-based authentications.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating web applications.NET features. It's the better as well as a recommended approach for large-scale applications where various teams are working together. The ASP. View and Controller.NET MVC framework offers the following advantages:  It makes it very easy to manage complexity by dividing an application into the Model. JavaScript and CSS.

 Ajax essentially puts JavaScript technology and the XMLHttpRequest object between your Web form and the server. We can also define Ajax is a combination of client side technologies that provides asynchronous communication between the user interface and the web server so that partial page rendering occurs instead of complete page post back. without reloading the entire page. Ajax stands for Asynchronous JavaScript and XML.NET? Answer. and spawn an asynchronous request to the server to fetch results. This means that it is possible to update parts of a web page. 6. DOM. Secured: If the cookies are to be passed in a secure connection then it only returns True. the form on the users screen doesn't flash. It partially renders the page to the server instead of complete page post back. blink. 5. in other words AJAX is a cross-platform technology that can be used on any Operating System since it is based on XML & JavaScript. or stall. 2. Path: Contains the Virtual Path to be submitted with the Cookies. disappear. For further info click on the link:  Introduction to Ajax and Ajax Control Toolkit . you can use JavaScript and DHTML to immediately update the UI. HasKeys: If the cookies have a subkey then it returns True. We use AJAX for developing faster. AJAX uses a HTTP request between web server & browser.  With AJAX.  The power of AJAX lies in its ability to communicate with the server asynchronously. It also supports open source implementation of other technology. XHTML. 3. Ajax is platform-independent.  When the response is generated. Limitation of the Cookies 1. etc. The size of cookies is limited to 4096 bytes. when a user clicks a button. in other words Ajax is the combination of various technologies such as a JavaScript. A total of 20 cookies can be used in a single website. CSS. you can then use JavaScript and CSS to update your UI accordingly without refreshing the entire page. For further info click on the link:  Introduction To Cookies in ASP. using a XMLHttpRequest object without requiring a browser refresh.Net Question 9: What is Ajax in ASP. better and more interactive web applications. Name: Contains the name of the Key. While this is happening. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. 7. Value: Contains the value of the cookies. 4.

NET Web Service Basics Question 11: What are the Advantages of ASP. multiplying two numbers together to an entire customer-relationship management system).Offers a uniform method of describing web services to other programs.  Programmable (encapsulates a task).  It assumes a stateless service architecture. any application that understands XML-regardless of the application's programming language or platform-has the ability to format XML in a variety of ways (well-formed or valid).Provides a communication mechanism between services and applications. and execution of Web .  Discoverable (search and locate in registries).  Scalable (e.  Platform Independent. For further info click on the link:  ASP. This is based on UDDI.  WSDL. So.  Protocol Independent. A web service is:  Language Independent. text-based standard).ability of applications and developers to search for and locate desired Web services through registries. Web Services are a way for interacting with objects over the Internet.NET? Answer: A Web Service is a software program that uses XML to exchange information with other software via common internet protocols.  Self-describing (metadata for access and use).NET? Answer: ASP.  Based on XML (open.  UDDI. Key Web Service Technologies:  XML. deployment.Describes only data. In a simple sense.g.  SOAP.NET provides services to allow the creation.Question 10: What are Web Services in ASP.Enables the creation of searchable Web services registries.

We will discuss more about this "Accordingly operations over diff.Applications and Web Services like ASP. The namespaces involved in creation of globalize. culture data".NET framework has greatly simplified the task of creating the applications targeting the clients of multiple cultures. and Globalization means "process of designing applications that can adapt to different cultures". It should well also be able to operate over this data. and Display all global kind of data. Verify. which are responsible for generating the user interface. ASP.Resources  System. Web Applications are built using Web Forms.NET Question 12: What is the concepts of Globalization and Localization in .  Proper Globalization: Your application should be able to Accept.NET comes with built-in Web Form controls. ASP. and other operations from the executable code. They mirror typical HTML widgets such as text boxes or buttons.  Localizability and Localization: Localizability stands for clearly separating the components of culture based operations regarding the user interface.NET? Answer: Localization means "process of translating resources for a specific culture".Globalization  System.NET is a server-side technology. . If these controls do not fit your needs. Advantages of ASP.NET Framework  Graphical Development Environment  Update files while the server is running  XML-Based Configuration Files For further info click on the link:  Introduction to ASP. localizing applications are:  System. accordingly.Text .NET:  Separation of Code from HTML  Support for compiled languages  Use services provided by the . you are free to create your own user controls.

NET applications. Generally a website contains a single Web. Each file is an XML file (with the extension . As the operating system uses a process to isolate misbehaving code.  You need not restart the web server when the settings are changed in configuration file.For further info click on the link:  Globalization and Localization in .NET Configuration system is used to describe the properties and behaviors of various aspects of ASP. ASP.NET Web Configuration File Question 14: What is the App Domain Concept in ASP. It can be considered as a Lightweight process which is both a container and boundary.  You can use any standard text editor or XML parser to create and edit ASP. it can be unloaded.config file stored inside the application root directory.NET: Part I Question 13: What is the Web.NET? Answer: ASP. just like the operating system uses a process as a container for code and data. For further info click on the link:  ASP. How to create AppDomain: AppDomains are created using the CreateDomain method. However there can be many configuration files that manage settings at various levels within an application. AppDomain instances are used to load and execute assemblies (Assembly). public string GetInfo() . The CLR can allow the multiple .NET Configuration system is extensible and application specific information can be stored and retrieved easily. When an AppDomain is no longer in use.NET automatically detects the changes and applies them to the running ASP.NET configuration files.NET applications to run in a single AppDomain. It is human readable.NET runtime uses an AppDomain to isolate code inside a secure boundary. The settings are stored in XML files that are separate from your application code.NET introduces the concept of an Application Domain which is shortly known as AppDomain. { 3. In this way you can configure settings independently from your code.NET application. The .config) that contains a set of configuration elements.config file in ASP? Answer: Configuration file is used to manage various settings that define a website. Mulitple Appdomains can exist in Win32 process. the . 1. Configuration files help you to manage the settings related to your website. public class MyAppDomain: MarshalByRefObject 2.NET runtime uses an AppDomain as a container for code and data. Usage of configuration file ASP. Configuration information is stored in XML-based text files. Benefits of XML-based Configuration files:  ASP.

a Query String is Easy to use and the Query String follows a separating character. A Query String is helpful when we want to transfer a value from one page to another. 4. .Net Question 15: What is Query String in ASP? Answer: A QueryString is a collection of characters input to a computer or web browser. 6. When we need to pass content between the HTML pages or aspx Web Forms in the context of ASP. } 18. A Query String Collection is used to retrieve the variable values in the HTTP query string. { 5. 16. AppDomain apd = AppDomain.  Used to send or read cross domain (from different domain). It is basically used for identifying data appearing after this separating symbol.QueryString(variable)[(index). public class MyApp 9.CreateInstanceAndUnwrap(Assembly. public static void Main() 11. "MyAppDomain").GetInfo()).CreateDomain("Rajendrs Domain").FriendlyName.CurrentDomain. Console. If we want to transfer a large amount of data then we can't use the Request. return AppDomain. } 7.WriteLine("Application Name = " + apdinfo.GetCal lingAssembly() 14. } For further info click on the link:  AppDomain concept in ASP. .Name. } 8. 13.GetName() 15. . Query Strings are also generated by form submission or can be used by a user typing a query into the address bar of the browsers. MyAppDomain apdinfo = (MyAppDomain) apd.count] Advantages:  Simple to Implement  Easy to get information from Query string. { 12. 17. Syntax of Query String Request.NET.QueryString. usually a Question Mark (?). { 10.

Change the Id of ContentPlaceHolder in <Head> to "cphHead" and the Id "ContentPlaceHolder1" to "cphFirst".Disadvantages:  Human Readable  Client browser limit on URL length  Cross paging functionality makes it redundant  Easily modified by end user For further info click on the link:  Query Strings in ASP. </asp:ContentPlaceHolder> 2.. 3. We can have multiple masters in one web application.master'.master". The MasterPageFile property of a webform can be set dynamically and it should be done either in or before the Page_PreInit event of the WebForm. Add one more ContentPlaceHolder (cphSecond) to Master page.A MasterPage can have another MasterPage as Master to it. 1.. <br /> 5. MasterPage cannot be directly accessed from the client because it just acts as a template for the other Content Pages. <asp:ContentPlaceHolder ID="cphSecond" runat="server"> This is Second Content Place Holder (Default).MasterPageFile = "MasterPage. 2.NET? Answer: The extension of MasterPage is '. Page. A master page is defined using the following code: <%@ master language="C#" %> Adding a MasterPage to the Project 1. 2. <asp:ContentPlaceHolder id="cphFirst" runat="server"> This is First Content Place Holder (Default) </asp: ContentPlaceHolder> 4. <br /> 3. </form> For further info click on the link: ..Net Question 16: What is master page in ASP. To the master page add some header. In a MasterPage we can have content either inside ContentPlaceHolder or outside it. <br /> Footer. Add a new MasterPage file (MainMaster. <form id="form1" runat="server"> Header. 3. Only content inside the ContentPlaceHolder can be customized in the Content Page. 4. footer and some default content for both the content place holders.master) to the Web Application.. 1. The dynamically set Master Page must have the ContentPlaceHolder whose content has been customized in the WebForm.

and database queries and integrate them with your ASP.Net Question 18: What are the data controls available in ASP. expressions and/or methods. But if you want to increase the number of requests and discard the older request and display a recent request then you need to set the property in the web. We can see the most recent tracing of the data. Data binding allows you to take the results of properties. Tracing has the following important features: 1. Tracing can be done with the following 2 types.NET code.NET allows powerful feature of data binding.NET. <%@ Page Trace="true" Language="C#" 2. The default number of requests to store is 10.  Master Page in ASP. 2.NET? Answer: Tracing helps to see the information of issues at the runtime of the application. Controls -> Child Control Data Binding is binding controls to data from databases. Data binding provides simple. you can bind any server control to simple properties. 3. With data binding we can bind a control to a particular column in a table from the database or we can bind the whole table to the data grid. <trace enabled="true"/> For further info click on the link:  Introduction to Tracing in . and powerful way to create a read/write link between the controls on a form and the data in their application. ASP. 1. you have more flexibility when you use data from a database or other means. collections.NET Question 17: What is tracing in . collection. method calls. Application: Level: In Application-Level tracing the information is stored for each request of the application. Page Level: When the trace output is displayed on the page and for the page-level tracing we need to set the property of tracing at the page level. You can combine data binding with Web control rendering to relieve much of the programming burden surrounding Web control creation. convenient. You . By default Tracing is disabled.config file. When you use data binding. We can see the execution path of the page and application using the debug statement. We can access and manipulate trace messages programmatically. Data Bind controls are container controls.NET? Answer: The Controls having DataSource Property are called Data Controls in ASP.

For further info click on the link:  Data Bind Controls in ASP. Expressions within the data binding tags are evaluated only when the DataBind method in the Page objects or Web control is called. maintains a pool of HttpApplication objects.NET:  Repeater Control  DataGrid Control  DataList Control  GridView Control  DetailsView  FormView  DropDownList  ListBox  RadioButtonList  CheckBoxList  BulletList etc.NET? . and assigns them to applications as needed.NET Question 19: What are the major events in global.ASAX file Question 20: Use of CheckBox in . which is derived from the HttpApplication class.aspx? Answer: The Global. Following are data bind controls in ASP. The difference between a data binding tags and a regular code insertion tags <% and %> becomes apparent when the expression is evaluated.NET and Web controls to populate control contents from SQL select statements or stored procedures. Data Bind Control can display data in connected and disconnected model.NET to evaluate the expression. which instructs ASP.asax file.can also use data binding with ADO.asax file contains the following events:  Application_Init  Application_Disposed  Application_Error  Application_Start  Application_End  Application_BeginReques For further info click on the link:  Major Events in GLOBAL. The Global. Data binding uses a special syntax: <%# %> The <%#.

. runat Specifies that the control is a server control. Text The text next to the check box. Group of controls for which the Checkbox control causes validation when it posts ValidationGroup back to the server.NET authentication means to identify the user or in other words its nothing but to validate that he exists in your database and he is the proper user. Authorization means does he have access to a particular resource on the IIS website. LabelAttributes Attribute names and values used for the Label element for the CheckBox control. JPEG etc). In ASP. unlike radio buttons it can select multiple items on a webpage. A resource can be an ASP.Answer: The CheckBox control is a very common control of HTML. The CheckBox control in ASP.NET Question 21: What is the authentication and authorization in ASP.NET web page. Checked Specifies whether the check box is checked or not.NET has many properties and some of them are listed below. The default is false. RAR) etc. compressed file (ZIP. TextAlign On which side of the check box the text should appear (right or left). OnCheckedChanged The name of the function to be executed when the Checked property has changed.NET? Answer  Authentication: Prove genuineness  Authorization: process of granting approval or permission on resources. Must be set to "server". CausesValidation Specifies if a page is validated when a Button control is clicked. For further info click on the link:  Use CheckBox inside Gridview in ASP. InputAttributes Attribute names and values used for the Input element for the CheckBox control. Property Description Specifies whether the form should be posted immediately after the Checked AutoPostBack property has changed or not. media files (MP4. GIF.

If Authentication is successful it will return a token to your website. hotmail. 1.Types of authentication and authorization in ASP.So when user logins with credentials it will be reached to the passport website ( i. </authorization> For further info click on the link:  ASP.e.  Passport authentication: Passport authentication is based on the passport website provided by the Microsoft . <authorization> 2.config' file set the authentication mode to 'Windows' as shown in the below code snippets.devhood.NET Authentication and Authorization Question 22: What are the HTML server control in ASP. <deny users="?"/> 3. 1.NET There are three ways of doing authentication and authorization in ASP.NET web pages will use local windows users and groups to authenticate and authorize live etc) where authentication will happen. '?' indicates any unknown user.NET? . Form-based authentication presents the user with an HTML-based Web page that prompts the user for credentials. <authentication mode="Windows"/> We also need to ensure that all users are denied except authorized users.  Anonymous access: If you do not want any kind of authentication then you will go for Anonymous access. In 'web. The below code snippet inside the authorization tag that all users are denied.  Forms Authentication: This is a cookie based authentication where username and password are stored on client machines as cookie files or they are sent through URL for every request.NET:  Windows authentication: In this methodology ASP.

Controls Description HtmlForm Create an HTML form control.). HtmltextArea Creates multiline text box control. HtmlInputRadioButton Creates a radio button control. which they use to write GUI applications in HTML. What's about difference and how to you use them? (Authentication have some other values to. HtmlInputText Creates an input text box control used to get input from user. which is used to display an image. How to use mode "Windows"? .NET for security? Answer: When you begin a program for a customer using ASP. this article does not consider them.NET Server-Side controls Question 23: What are the authentication modes in ASP. ASP. There are four types of Server controls: HTML server controls. HtmlAnchor Creates a Web navigation. HtmlButton Creates a button control. Security is one of the most important components of any application. HtmlTableCell Creates a cell with in a row. HtmlTableRow Creates a row within a table. In this article we will investigate the different types of authentication provided by ASP. Web server controls. used as a place holder of other controls. o Web Server Controls o Validation Controls o User Controls For further info click on the link:  ASP .  HTML Server controls HTML developers must be familiar with old HTML controls.NET.NET. you can run these controls on the server by defining the runat ="server" attribute. and user controls. Security is even more important when you are making a web application which is exposed to million of users. HtmlImage Creates an image control.config file you can set authentication mode value 'windows' or 'forms'.NET provides classes and methods that ensure that the application is secure from outside attacks. you should consider about security. HtmlInputCheckBox Creates a check box control. These controls are the same HTML controls. In web. validation control.NET Framework provides a rich set of server-side controls for developing Web applications. You can add these controls to WebForms pages just as you add Windows controls to a form. HtmlTable Creates a table control. These control names start with Html.Answer: The Microsoft. Server-side controls are often called server controls or Web Forms controls.

Server Error Features:  It is light weight and thus good for small devices also like tablets. There are many frameworks available to build HTTP based services.Successful  3xx .  It support content-negotiation (deciding the best response data format that client can accept).  MediaTypeFormatter makes easy to configure your APIs response type in single line (JSON.Redirection  4xx . <forms name=" AuthenticationDemo" loginUrl="logon.Client Error  5xx . </authentication> How to use mode "Forms"? Insert the <Forms> tag. This is the default authentication mode provider by ASP.  No tedious & extensive configuration like WCF REST is required. Versioning. request/response headers and its various content formats. 1.Net for Security Question 24: What is the web API in ASP. <authentication mode="Windows"> 2. For example. This will return the computer name along with the user name. 1.aspx" protection="All" path="/"tim eout="30" /> 3. and fill the appropriate attributes. <authentication mode="Forms"> 2. </authentication> For further info click on the link:  Authentication Modes in ASP. smart phones.Windows Authentication mode provides the developer to authenticate a user based on Windows user accounts.  Easy and simple control with HTTP features such as Caching.NET Web API . They follow a common guideline of international standardization but with different flavors. For further info click on the link:  Basic Understanding On ASP. XML and so on). all framework must adhere to these status codes-  1xx .NET.Informational Message  2xx .  IIS Hosting dependency is no more and it can be hosted in application too.aspx" protection="All" path="/"tim eout="30" /> 3.NET? Answer: It is a framework provided by Microsoft for writing HTTP services. <forms name=" AuthenticationDemo" loginUrl="logon.

Question 25: Describe application state management in ASP. Whenever the webserver has been restarted or stopped then the information maintained by the application object will be lost. EventArgs e) 4. <%@ Application Language="C#" %> 2. // Code that runs on application startup 6. void Session_End(object sender. { 9. // Code that runs on application shutdown 10. Application object will not have any default expiration period.asax): It is a Class which consists of event handlers which executes the code implicitly whenever a relevant task has been performed on the web server. </script> For further info click on the link:  Application Level State Management in ASP. void Application_Start(object sender. { 5. } 19. EventArgs e) 16. { 17. { 13. // Code that runs when a session ends. } 11. it is advisable to lock and unlock the application object as per requirement. void Session_Start(object sender.NET? Answer: Application Level State Management is used to maintain the state of all the users accessing the web forms present within the website.NET Question 26: What is the code behind and Inline Code? Answer: . } 23. EventArgs e) 8. Since the information is shared among all the users. { 21. 22. <script runat="server"> 3. EventArgs e) 12. EventArgs e) 20. } 15. // Code that runs when an unhandled error occurs 14.Design: 1. If any data is stored on the application object then that information will be shared upon all the users accessing the webserver. } 7. Global Application Class(Global. void Application_Error(object sender. void Application_End(object sender. The value assigned for an application is considered as an object. // Code that runs when a new session is started 18.

cs or . The periods between the request and response of a page is called the "Page Life Cycle". At this point also the page properties such as Response and Request are unloaded. It's major point is that since it's physically in the . Unload is called after the page has been fully rendered.NET Question 27: What is the ASP.NET Web page that is written in a separate class file that can have the extension of . the View State is saved for the page and its controls. Initialization 2. Unloading During this stage the IsPostback property is set.vb code file for each . . the request goes through a series of steps and many things happen in the background to produce the output or send the response back to the client. providing a text writer that writes its output to the OutputStream of the page's Response property. Rendering the page calls the render method for each control. Later in this article we"ll study all these stages and their sub events. Controls on the page are available and each control's UniqueID property is set. One major point of Code Behind is that the code for all the Web pages is compiled into a DLL file that allows the web pages to be hosted free from any Inline Server Code.aspx. Here the code is compiled into a separate class from which the . Rendering 4. For further info click on the link:  Code Behind and Inline Code in ASP.  Request: Start of the life cycle (sent by the user). Now if the current request is a postback then the data has not been loaded and the value of the controls have not yet been restored from the view state.aspx.aspx page.aspx file derives. During this phase. sent to the client and is ready to be Unloading discarded. You can write the code in a separate .aspx.NET page life Cycle? Answer: When a page is requested by the user from the browser. It allows the code to be written along with the HTML source code using a <Script> tag. Loading 3. The page determines whether the request is a Postback (old request) or if this is the first time the page is being processed (new Initialization request). Loading At this stage if the request is a Postback then it loads the data from the view state.NET Web Page that has an extension of .cs or . Before rendering.aspx file it's deployed with the Web Form page whenever the Web Page is deployed.vb depending on the language used. There are four stages that occur during the Page Life Cycle before the HTML Response is returned to the client.Code Behind Code Behind refers to the code for an ASP.  Response: End of the life cycle (sent by the server). Inline Code Inline Code refers to the code that is written inside an ASP. 1.

 Page load At this stage.  Unload The rendered page is sent to the client and page properties.  Validation Validate method of the validation control is called and if it runs successfully.NET page life cycle let’s see some most important events:  Page request When ASP.Net Page Life Cycle Question 28: What is the ASP. the controls on the page are assigned unique ID by setting the UniqueID property and themes are applied. view state for the page and all controls are saved.For further info click on the link:  ASP. the IsValid property of the page is set to true.  Postback event handling If the request is a postback (old request). ASP.NET page life cycle events? Answer: We have many events in ASP. control properties are set using the view state and control state values.  Starting of page life cycle At this stage. The UICulture property of the page is also set.  Page initialization At this stage. For a new request postback data is loaded and the control properties are restored to the view-state values.  Page rendering At this stage. the IsPostBack property of the page is set to true. such as Response and Request are unloaded and all cleanup done. it decides whether to parse and compile the page or there would be a cached version of the page.NET gets a page request. the Request and Response objects are set. The page calls the Render method for each control and the output of rendering is written to the OutputStream class of the Page's Response property. If the request is an old request or post back. the related event handler is called.NET Page Life Cycle Events Following are the page life cycle events: . accordingly the response is sent.

 PreRender The PreRender event occurs just before the output is rendered. .  LoadViewState LoadViewState event allows loading view state information into the controls. This event can be handled by overloading the OnLoadComplete method or creating a Page_LoadComplete handler. It checks the IsPostBack property and determines whether the page is a postback.  Load The Load event is raised for the page first and then recursively for all child controls.  PreLoad PreLoad occurs before the post back data is loaded in the controls. The controls in the control tree are created. By handling this event. This event can be handled by overloading the OnPreLoad method or creating a Page_PreLoad handler.  Init Init event initializes the control property and the control tree is built.  PreRenderComplete as the PreRender event is recursively fired for all child controls. control event handlers are run and page validation takes place. creates dynamic controls and gets and sets profile property values. the contents of all the input fields defined with the <form> tag are processed. This event can be handled by overloading the OnLoad method or creating a Page_Load handler. PreInit PreInit is the first event in page life cycle. All the controls turn on view-state tracking. this event ensures the completion of the pre-rendering phase. This event can be handled by overloading the OnInit method or creating a Page_Init handler.  LoadComplete The loading process is completed. This event can be handled by overloading the OnPreInit method or creating a Page_PreInit handler. pages and controls can perform any updates before the output is rendered.  LoadPostData During this phase.  InitComplete InitComplete event allows tracking of view state. It sets the themes and master pages.

The Login Control consists of:  Username Label and Textbox: Collects the string used to identify the user in the membership system. For Example: 1.Net and its Events Question 29: Describe login Controls in ASP? Answer: The Login control provides the user interface to log a user into a web site. The repeater control is used to display a repeated list of items.  Title and Instruction: Text to orient and guide the user through the process.  Links: Configurable links to help. For further info click on the link:  Page Life Cycle in ASP. such as database connections.  UnLoad The UnLoad phase is the last phase of the page life cycle. The textbox text is always obscured. .  Validators: Required field Validators for the username and password textboxes.  LoginButton: The button to submit the users request for authentication. are freed. It creates a link between the Data Source and the presentation UI to display the data.  Password Label and Textbox: Collects the password for the specified user. This stage can be handled by overriding the Render method or creating a Page_Render handler.NET? Answer: A Repeater is a Data-bound control. <asp:Login ID="Login1" runat="server" BackColor="#FFE0C0" BorderColor="Red" ></asp:Logi n> For further info click on the link:  How to use Login Control in Visual Studio 2008 Question 30: How to use repeater control in ASP. Data-bound controls are container controls. The Login control uses the Membership service to authenticate the user in your membership system.  SaveStateComplete State of control on the page is saved. The default Membership service from your configuration file will be used automatically. Final cleanup is done and all resources and references. password recovery and user registration information. It raises the UnLoad event for all controls recursively and lastly for the page itself. however you can also set the Membership provider that you would like used as a property on the control.  RememberMe: Configurable to display a checkbox giving the user the option to store a persistent cookie on the user's machine. Personalization. The HTML markup is generated. This event can be handled by modifying the OnUnLoad method or creating a Page_UnLoad handler. control state and view state information is saved.

aspx file like: 1. DataTable dt = new DataTable(). <td>Student Name</td> 12. <%#Eval("S_ID")%> 8. con).Initial Catalog=yat endra. protected void Page_Load(object sender. <ItemTemplate> 3. <tr> 29. <%#Eval("D_O_B")%> 26. <tr> 11. EventArgs e) 2. } Now use Repeater control object in . A Repeater Control is faster and lightweight for displaying data compared to a GridView or DataGrid.The main use of Repeater Control is for displaying a repeated list of items bound to the control. Password = Password$2 "). With the Repeater control we can display data in a custom format. <asp:Repeater ID="Repeater1" runat="server"> 2. </td> 21. </tr> 28.DataSource = dt. </td> 27. <td>Date Of Examination</td> . Repeater1. <%#Eval("Student_Name")%> 14.Persist Security Info=True. <th>Student 7. SqlDataAdapter sda = new SqlDataAdapter("select * from Student_Details1". </tr> 10. </tr> 16. <tr> 17. <tr> 6. <div> 4. The main drawback of a Repeater Control is that it doesn't support paging and sorting. </td> 15. 4. The Repeater Control has the following types of template fields:  Item Template  AlternatingItem Template  Header Template  Footer Template  Separator Template Write connection code and select command in code bihaind file like: 1. <td> 13.Fill(dt). sda. Repeater1. </tr> 22. SqlConnection con = new SqlConnection("Data Source=MCNDESKTOP34. <td> 19.Dat aBind(). <table> 5. <%#Eval("Register_No")%> 20. <tr> 23. <td>Registration Number</td> 18. <td> 25. 6. { 3. <td>Date Of Birth</td> 24. 5.User ID=sa. </th> 9.

<td> 31. </tr> 34. <%#Eval("D_O_E")%> 32. <%#Eval("Department")%> 38. </td> 33. </tr> 40. </ItemTemplate> 43. <td>Department</td> 36. <td> 37. 30. <tr> 35. </asp:Repeater> When you run this page so output will look like as: . </td> 39. </div> 42. </table> 41.

A session is one of the best techniques for State Management because it stores the data as client-based.Net Repeater Control Using C# Question 31: What are different methods of session maintenance in ASP. in other words .NET? Answer: Session is a State Management Technique. It can support any type of object to be stored along with our own custom objects. A Session can store the value on the Server.For further info click on the link:  ASP.

the data is stored for every user separately and the data is secured also because it is on the server. Machine Configuration file: Machine Configuration is applied for all application. We can set the session on one of the following 2 types of configuration files: 1.NET there are 4 types of Session Mode. Off: We can disable the session mode for the entire application using the off mode. 2. Application Configuration file: It's applied for only application by application basis. . Session Mode In ASP.

It means that it is simply session data that will be different for the various users for all the various users.Current.NET Sessions Question 32: What is the Difference between session and caching? Answer: The first main difference between session and caching is: a session is per-user based but caching is not per-user based. For further info click on the link:  Difference Between Session and Caching Question 33: What is the difference between HttpContext.Items and HttpContext. session memory will be allocated differently on the server but for the caching only one memory will be allocated on the server and if one user modifies the data of the cache for all. So what does that mean? Session data is stored at the user level but caching data is stored at the application level and shared by all the users.State Server and SQL Server is: Session mode Performance Durability InProc More(1 processor and 1 server) less. the user data will be modified. State Server Medium(n processor and 1 server) Medium SQL Server Less More For further info click on the link:  ntroduction To ASP.Current.Session in .According to performance and durability the difference between InProc.

{ 14.WebControls. 5. It’s pretty simple to manage session if you understand the basic concept.Session["Value"])).Items["Value"] = "Sourav Kayal in ITEM". using System. 17. HttpContext. public partial class WebForm1: System.Web. { 16.Current. Here is the syntax to do that.Current.Generic.Web. { 12. using System.ASP. Or 1.Transfer and Response. using System. } 27.Write((string)(HttpContext.Items["Value"]) + "<br>").Web.Net Question 34: What is the difference between Server. EventArgs e) 23.Web.Write((string)(HttpContext.Write((string)(HttpContext.Linq.Items and HttpContext.Current.Session in ASP. Response. protected void Page_Load(object sender.Page 11. Session[“KEY”] =”Value”.redirect? .UI. namespace WebApp 9. We developer people play with session storage every now and then. 6. } 28. if(!IsPostBack) 15. 3. 18.Items["Value"]) + "<br>"). Response.Current.NET? Answer: Session state is one of the popular state management techniques in ASP. protected void Button1_Click(object sender. EventArgs e) 13. 8. using System. HttpContext.Session["Value"])). 1.Current.UI. 25. } For further info click on the link:  Difference Between HttpContext. 2.Current. Response. using System. Response. Let’ s a have an example: using System. 20.NET environment. } 22.UI. { 10. 7. 26.Session["Value"] = "Sourav Kayal in SESSION". 4.Current. { 24. 19.Current.Collections. Session[index] = ”Value”. } 21.Write((string)(HttpContext.

Transfer("UserDetail.Redirect() and Server. 2. it starts with "<%@" and ends with "%>".aspx").Redirect("UserDetail.Redirect method redirects a request to a new URL and specifies the new URL while the Server. The Response. these are important for the understanding of the basic differences between these two. Response. The HTTP status codes are the codes that the Web server uses to communicate with the Web browser or user agent.NET page.Transfer() Methods in ASP. These commands are used by the compiler when the page is compiled.NET page.Transfer method for the current request.Net Question 35: What is page directives in ASP. You can write directives in the following format: <%@[Directive][Attributes]%> See the directive format.Redirect and Server. Both methods are used for the same purpose but still there are some differences as follows.Redirect and Server.NET? Answer: Basically Page Directives are commands. One more thing.Answer: Both Response. How to use the directives in an ASP.NET page It is not difficult to add a directive to an ASP. But you can put a directive anywhere in a page. The best way is to put the directive at the top of your page. Both Response. you can put more than one attribute in a single directive. terminates execution of the current page and starts execution of a new page using the specified URL path of the page. Here is the full list of directives: .Transfer methods are used to transfer a user from one web page to another web page.aspx"). Before touching on more points I want to explain some HTTP status codes. It is simple to add directives to an ASP. Server. For further info click on the link:  Difference Between Response.Transfer has same syntax like: 1.

Handles Web user control pages. . persisting view state etc. 2. Trace Handler (trace. RSS .NET full page processing model. User Control Handler (.  @Page  @Master  @Control  @Import  @Implements  @Register  @Assembly  @MasterType  @Output Cache  @PreviousPageType  @Reference For further info click on the link:  ASP. Perform an ad hoc database query. Web Service Handler (.NET application is handled by a specialized component known as an HTTP handler.NET uses different HTTP handlers to serve different file types.NET default handlers: 1. as ASP. The HTTP handler is the most important ingredient while handling ASP.aspx) . Why we need to create our own HTTP Handler: Sometime we need to avoid ASP. For example.Use the System.NET requests. Examples: 1. Examples: ASP. 5. Dynamic image creator . ASP. This would allow you to add RSS feed capabilities to your sites.Handles Web service pages.web> element. 3. 2. Page Handler (. Render a custom image.NET web form model has to go through many steps such as creating web page objects. What we are interested into is to develop some low level interface that provides access to objects like Request and Response but doesn't use the full control based web form model discussed above. the handler for web Page creates the page and control objects. runs your code.ascx) .axd) .Handles trace functionality. which saves lot of overheads. and renders the final HTML.Drawing classes to draw and size your own images. 4.Create a handler that responds with RSS-formatted XML. 4. Return some binary data.Handles Web pages. 3.asmx) .Net Page Directives Question 36: What is HTTP Handler? Answer: Every request into an ASP. All HTTP handlers are defined in the <httpHandlers> section of a configuration file which is nested in the <system.

So whenever user requests a file it is processed by the handler based on the extension. AuthorizeRequest. Then the request is passed to the appropriate ISAPI extension.aspx" validate="true" type="System. HttpResponse are created. ProcessRequest etc. AuthenticateRequest. HTTP Handler HTTP Handler is the process which runs in response to a HTTP request. Now bind the .aspx page is requested it is passed to ASP.HttpForbiddenHandler" /> 5.Web. <add verb="*" path="*. For example when an .NET objects like Httpcontext. One can register different events of HttpApplication class like BeginRequest. <httpHandlers> 2.NET HttpHandler and HttpModule Question 38: Explain the AdRotator Control? . <add verb="*" path="*.NET 3. HTTP Modules HTTP Modules are plugged into the life cycle of a request.Handlers.Web. Then instance of HttpApplication is created and also instance of any configured modules. HttpRequest.NET page handler.PageHandlerFactory" /> </httpHandlers> For further info click on the link:  Create your first HTTP Handler in ASP. Let's consider an example to create RSS for a site.config" validate="true" type="System.UI. The web server examines the file name extension of the requested file.HttpForbiddenHandler " /> 4. and determines which ISAPI extension should handle the request. 1.Web. So generally http modules are used for:  Security: For authenticating a request before the request is handled.cs" validate="true" type="System. custom http handlers are created when you need to special handling based on the file name extension. So. create a handler that generates RSS-formatted XML.Web.rss extension to the custom handler.NET HttpHandler and HttpModule? Answer: The user requests for a resource on web server. <add verb="*" path="*. one can add custom header information to the response. For further info click on the link:  Difference between ASP. So when a request is processed it is passed through all the modules in the pipeline of the request.axd" validate="true" type="System.  Statistics and Logging: Since modules are called for every request they can be used for gathering statistics and for logging information.  Custom header: Since response can be modified. <add verb="*" path="trace.5 Question 37: What are Differences between ASP. So. Then Application domain is created and after that different ASP.TraceHandl er" /> 3.

<AlternateText>Cat 2</AlternateText> 6.Answer: AdRotator control are used to create a dynamic ads. <ImageUrl>adimages/3. <AlternateText>Cat 4</AlternateText> 18. select the AdRotator and drag and drop the control to your web form. The traditional workaround alternatives were to use Response. <NavigateUrl>http://cat3. The URL to link to if the user clicks the ad. </Ad> 8. <AlternateText>Cat 3</AlternateText> 12. XML code that has the details about the ads.xml looks like the code below: 1. The following are some of the elements of this XML file. The display rates in percent of the hits.The AdRotator control to work we need an Advertisement file (XML file) and some sample images. In many situations. it will navigate to a new Web location. <ImageUrl>adimages/4.jpg</ImageUrl></NavigateUrl> 5. <AlternateText>: Optional. The file Ads. The AdRotator Control presents ad images each time a user enters or refreshes a webpage. When the ads are clicked. <Ad> 15. <NavigateUrl>: Optional. <NavigateUrl>http://cat4. </Ad> 20. An alternate text for the image.NET 2. <ImageUrl>adimages/2.NET 1. <Impressions>20</Impressions> 13. the solution requires posting to a different web page. <Impressions>10</Impressions> 19. The path to the image file. <imageUrl>: Optional. first. ASP. 2. <Impressions>30</Impressions> 7.Transfer to move to a different page and simulate cross page post-back behavior. 1. <Ad> 9. <NavigateUrl>http://cat2. <Impressions>: Optional.NET Question 39: What is cross-page posting in ASP.Redirect and/or Server. 4.jpg</ImageUrl> 4. Map the XML file which contains the details about each and every ad. Adding the AdRotator web server control to your web</NavigateUrl> 11. <Advertisements> 2. <Ad> 3.1 provides for web forms posting back only to themselves.0 provides a feature known as Cross Page PostBack for a web form to post-back to a different web form (other than itself) How to post to a different page .com</NavigateUrl> 17. 3.jpg</ImageUrl> 10.NET? Answer: ASP. </Advertisements> For further info click on the link:  AdRotator control in ASP. The AdRotator control is used to display a sequence of ad images. The advertisement file is an XML file. </Ad> 14.

Text.aspx" %> 2. Access source page info within the posted page: @PreviousPageType Directive There is another more direct option to get access to the source page controls if the source page is pre-determined. <asp:textbox runat="server" id="txtLastName" /> 4.aspx: 1. The PreviousPage property then returns a strongly typed reference to the source page.To set a web form to post back to a different web form. The code will stop working if the control id is changed in the source web form. . The controls on the source page can be accessed via the FindControl method on the object returned by the PreviousPage property of the target page..FindControl("txtStartDate "). <asp:textbox runat="server" id="txtFirstName" /> 3. the web form is cross-posted to the target web form. the developer has to presume a certain structure in the source web form.FirstName //Strongly Typed PreviousPage allows direct acces s to the public properties of the source page . 2. No other settings or code is required in the source web form. protected void Page_Load(object sender. The PreviousPage property is of the type Page. you need to first get a reference to the parent control. set the PostBackURL property of a control that implements IButtonControl (eg. strFirstName = PreviousPage. 4.aspx" /> . 1..aspx 1.. LinkButton) to the target web form. When the user clicks on this button control. The directive specifies the source page using either the VirtualPath attribute or the TypeName attribute. EventArgs e) 2.. . ImageButton... Access source page info within the posted page: FindControl Method The target web form resulting from the cross-page postback provides a non-null PreviousPage property. { 3. Button. This approach using FindControl has a few limitations. FindControl is dependent on the developer to provide the ids of the controls to access. } At this point the target page does not have any knowledge of the source page. in the source web form. public string FirstName { get { return txtFirstName.. The FindControl method can retrieve controls only within the current container... TextBox txtStartDate = (TextBox) PreviousPage. } } . SourcePage. If you need to access a control within another control. string strFirstName. 6. <form runat="server"> . <asp:button runat="server" id="btnViewReport" Text="View Report" PostbackURL="~/tar getpage. <%@ PreviousPageType VirtualPath="sourcepage. This property represents the source page and provides reference to the source web form and its controls. For accessing controls using FindControl. TargetPage. It allows access to the public properties of the source page. 5. The @PreviousPageType directive can be used in the target page to strongly type the source page. 3..

 Multiple data fields for the hyperlink columns. NET Web API for creating the REST ful (Representational State Transfer) services. NET Web API:  Is an HTTP service. POST.  Is designed for reaching the broad range of clients. The request may be GET.  Programmatic access to the GridView object model to dynamically set properties. The response depends on the request of the clients.0 Question 40: Explain GridView control in ASP.  Uses the HTTP application.Net Question 41: What is the difference between ASP. We can also say that the ASP. and so on.NET Web API and WCF? Answer: The ASP. while each row represents a record.  Built-in paging capabilities.  Customizable appearance through themes and styles. and handles the request using the HTTP protocols. </asp:GridView> For further info click on the link:  GridView Control in ASP.  Multiple key fields. Creating a GridView 1.  Built-in sort capabilities. The GridView control supports the following features:  Binding to data source controls.NET? Answer: The GridView control displays the values of a data source in a table. We use the ASP.  Built-in update and delete capabilities. DELETE. Each column represents a field.For further info click on the link:  Cross Page Postback in ASP. <asp:GridView ID="gridService" runat="server"> 2. NET Web API is a framework that uses the HTTP services and makes it easy to provide the response to the client request. such as SqlDataSource. The following are some important points of the ASP. NET Web API: . handle events.  Built-in row selection capabilities.Net 2. The Web API builds the HTTP services. PUT.

NET? Answer: If we create a web Page. These fields will empty initially as shown below. 5.  Responses can be formatted by the APIs MediaTypeFormatter into the Java Script Object Notation (JSON) and Extencible Markup Language (XML) formats.aspx file. On the client side. 4. and the page is resubmitted to the server. For further info click on the link:  What is PostBack in ASP. it triggers a PostBack. This function is named _doPostBack() .NET re-creates the Page object using the . 8. the Page.c-sharpcorner.NET also adds two additional hidden input fields that are used to pass information back to the server. Finally. The Page.  The ASP. 1.Unload event is fired.NET Question 43: Explain Cookie-less Session in ASP. <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> The following actions will be taken place when a user changes a control that has the AutoPostBack property set to true: 1. media formatters. The new page is sent to the client. For further info click on the link:  http://www. the ASP. the JavaScript _doPostBack function is invoked.  It is a framework for creating the HTTP services. <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> 2. ASP. routing etcetera. the order of change events is undetermined.  It is a platform for creating the REST services. 7.NET adds a special JavaScipt function to the rendered HTML Page.Load event is fired. When Called. The appropriate change event is fired for the control. ASP. (If more than one control has been changed. and the page is rendered (transformed from a set of objects to an HTML page).com/UploadFile/2b481f/difference-between-Asp-Net-web-api-and- wc Question 42: What is the PostBack property in ASP. sending data back to the web Server. The Page. 3.NET retrieves state information from the hidden view state field and updates the controls accordingly. ASP. This information consists of ID of the Control that raised the event and any additional information if needed.NET.PreRender event fires. NET Web API supports the MVC application features that are controller.) 6. which consists of one or more Web Controls that are configured to use AutoPostBack (Every Web controls will have their own AutoPostBack property). . 2.

Setting the theme at the site level: to set the theme for the entire website you can set the theme in the web. We define themes in a special App_Themes folder. Add an attribute "cookieless" in the <sessionState> tag and set its value to "AutoDetect" like below: 1.Config file. If cookies are disabled. Setting the theme at the page level: the Theme attribute is added to the page directive of the page. CSS files & images.aspx. Theme2 etc.  UseDeviceProfile: Session uses background cookie if browser supports cookies else URL is used.web> tag. then the URL is used to store session information. 2. How to apply themes There are 3 different options to apply themes to our website: 1.  UseUri: Session always use URL. <pages theme="Theme1"> . It can include skin files.config file and locate the <pages> element and add the theme attribute to it: 1. Inside this folder is one or more subfolders named Theme1. Follow these steps: 1. 1. For further info click on the link:  Using Cookie-less Session in ASP. effectively overriding any customization you may have for individual controls on your page.config of the website. <sessionState cookieless="AutoDetect" regenerateExpiredSessionId="true"/> The possible values for "cookieless" attribute are:  AutoDetect: Session uses background cookie if cookies are enabled.Config file. they all get a new regenerated session url. "regenerateExpiredSessionId" is used to ensure that if a cookieless url is expired a new new url is created with a new session.NET Question 44: What is Themes in ASP.cs"Inherits ="Default" Theme="Theme1"%> 2. It is a collection of files that define the looks of a page. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default. And if the same cookieless url is being used by multiple users an the same time. that define the actual themes. we need to change some configuration in the Web.NET? Answer: A theme decides the look and feel of the website.Answer: By default a session uses a cookie in the background.  UseCookie: Session always use background cookie. The theme property is applied late in the page's life cycle. To enable a cookie-less session. 3. This is default. Add a <sessionState> tag under <system. Open Web. Open the web.

Page...Exceute  Cross page posting For further info click on the link:  Navigation Techniques in ASP. .  Response. you can change colors.NET? Answer: Navigation can cause data loss if it not properly handled.Transfer  Server. Uses of Themes 1. Themes allow you to improve the usability of your site by giving users with vision problems the option to select a high contrast theme with a large font size. Also you can switch between themes programmatically. images and skins.Theme = Theme1. The better option is to apply this to the Base page class of the site as every page in the site inherits from this class. user controls.NET Question 45: What are the Navigations technique in ASP. For further info click on the link:  Themes in ASP. Setting the theme programmatically at runtime: here the theme is set at runtime through coding.0 incorporates the concept of WEB PARTS in itself and we can code and explore that as easily as we have done with the other controls in the previous sessions. You can have as many themes as you want and you can switch between them by setting a single attribute in the web. We can compose web parts pages from "web parts". 1. Page_PreInit event should be handled for setting the theme. 4. you are offering your users a quick and easy way to change the page to their likings. .. which can be web controls. 2.NET? Answer: ASP.NET 2. It should be applied earlier in the page's life cycle ie. . fonts.Redirect  Server. 3. 2.. We will discuss the following techniques in this article. Setting the themes programmatically.. We do have many techniques to transfer data from one page to another but every technique has its own importance and benefits.. </pages> 3.config file or an individual aspx page. 3. Since themes can contain CSS files. positioning and images simply by applying the desired themes. 4.Net Question 46: What is WebParts in ASP.

MasterPage cannot be directly accessed from the client because it just acts as a template for the other Content Pages. Page.MasterPageFile = "MasterPage. 4. A single ASPX page can contain one or more Web Part Zones. The dynamically set Master Page must have the . 6. A MasterPage can have another MasterPage as Master to it.master'. 7. For further info click on the link:  Understanding WEBPARTS in ASP.master". A master page of one web application cannot be used in another web application. 8. Only content inside the ContentPlaceHolder can be customized in the Content Page. We can have multiple masters in one web application. 5. The extension of MasterPage is '. The MasterPageFile property of a webform can be set dynamically and it should be done either in or before the Page_PreInit event of the WebForm. 2. In a MasterPage we can have content either inside ContentPlaceHolder or outside it. The content page content can be placed only inside the content tag.  This provides the layout for the Controls it contains.Component of Web Parts: The web parts consist of different components like:  Web Part Manager  Web Part Zone  CatLog Part  CatLog Zone  Connections Zone  Editor Part  Editor Zone Web Part Zone  Web Part Zone can contain one or more Web Part controls.NET 2. Controls of MasterPage can be programmed in the MasterPage and content page but a content page control will never be programmed in MasterPage.  A Web Part Control can be any of the controls in the toolbox or even the customized user controls.0: Part I Question 47: What are master pages? Answer: Some points about Master Pages: 1. 9. 3.

10. Enterprise Library Application Blocks . server execute the stored procedure or function or select statements on the Sql Server database then it returns the response to the browser.Remove(String key). The order in which events are raised: Load (Page) a Load (Master) a LoadComplete (Page) i.e.NET? Answer: Enterprise Library: It is a collection of application blocks and core infrastructure. We need to use System. The scope of the data caching is within the application domain unlike "session".Caching namespace. 1.Web. Enterprise library is the reusable software component designed for assisting the software developers. We use the Enterprise Library when we want to build application blocks intended for the use of developers who create complex enterprise level application. How to create data cache? Cache ["Employee"] = "DataSet Name" We can create data caching use Cache Keyword. Every user is able to access this object.NET Question 49: Enterprise Library in ASP.NET Question 48: What is Data Cache in ASP. Page_Load is the name of method for event handler for Load event of Master. It's just like assigning value to the variable. When client request to the server. How to remove a Data Cache? We can remove Data Cache manually. (it's not Master_Load). For further info click on the link:  Master Page in ASP. 11. It's located in the System. ContentPlaceHolder whose content has been customized in the WebForm.NET and how to use? Answer: Data Cache is used to store frequently used data in the Cache memory. if we want to overwrite something already done in Load event handler of Master then it should be coded in the LoadComplete event of the page. //We need to specify the cache name 2. If we run again same process will happen on the web server with sql server.Caching namespace. Cache. For further info click on the link:  Data Cache in ASP.Web. It's much efficient to retrieve data from the data cache instead of database or other sources.

Security Application Block Security Application Block provide developers to incorporate security functionality in the application. instead of bringing the records as a whole. Exception Handling Application Block This block provides the developers to create consistency for processing the error that occur throughout the layers of Enterprise Application.NET Question 50: How can we improve the Performance of an ASP. If your web page involves paging concepts. 4. Check in every table (who are all part of the query) Index is created properly.NET Web site. 1. one of the aspx page take much time to load. which in turn use lot of joins. try to move the paging concepts to SQL Server. For illustrative purpose. Then use SQL Server Profiler and Execution plan for that query so that you can come to a conclusion in which part it took much time. 3. Throughout this article. I meant that based on the page count the SP will return the records. Some of them we look into from the “backend side” (Database side) and rest of them we need to take care in “front-end” ((UI) side.NET forum to any interview. . Cryptography Application Block Cryptography application blocks provides developers to add encryption and hashing functionality in the applications. 2. you have an ASP. If your query involves a complex stored procedure. Back End (DB) 1. 3. In some cases. This application can use various blocks such as authenticating and authorizing users against the database. In this post I’m going to point out some of the important points that may help to improve the performance. sub-query perform better than the joins. we are going to see how to decrease the loading time. There are various reasons behind. 4. Here I used the word “improve performance” in the sense to decrease the loading time of the page. Try to check the Query performance that is how much time the query will take to execute and pull the records from DB.NET Web Page? Answer: This is the most common question from ASP. Caching Application Block Caching Application Block allows developers to incorporate local cache in the applications. then you should focus on every table. 2. For further info click on the link:  Enterprise Library In ASP.

You can also view ViewState information as described in this article How to view information in ViewState using ASP.NET. How can you detect if a viewstate has been tampered? 17. How can I configure ASP. At ASP. Yes.5. Viewstate stores the state of controls in HTML hidden fields. By using the Protected Configuration feature. You can use the Web Site Administration Tool to configure remote websites.aspx 10. This process builds each page in your web application into a single application DLL and some placeholder files.NET 2. 15.NET Interview Questions and Answers – Experienced Developers 6.config for this to work.NET in the respective subfolders. Update: However. 8. 21. Viewstate can be compressed to almost 50% of its size. 18. You can obfuscate your code by using a new precompilation process called ‘precompilation for deployment’. Can I use different programming languages in the same application? 20. . Yes. You also have to add configuration settings in the web.NET Pages compliant with XHTML? 7.config files in an application. You can place a Web. thereby affecting performance. You can keep multiple web. However the freedom has been given to the user to include the appropriate document type declaration. You can also accomplish the same task using Visual Studio 2005 by using the Build->Publish menu. 9. In simple words.config file inside a folder or wherever you need (apart from some exceptions) to override the configuration settings that are inherited from a configuration file located at a higher level in the hierarchy. How many web. this information can grow in size. . More info can be found at http://msdn2. No. 12. This does affect the overall responsiveness of the page.5 19. 13. you can create two subfolders inside the App_Code and then add both C# and VB. ASP. Can the App_Code folder contain source code files in different programming languages? 22. Another option is explained by Scott Hanselmann over here. The ideal size of a viewstate should be not more than 25-30% of the page size. 16.exe to precompile a site. You can use the aspnet_compiler. 23.NET also provides the GZipStreamorDeflateStream to compress viewstate.NET configures IIS to deny access to any user that requests access to the Machine.NET applications that are running on a remote machine? 29.config files.NET 2. 28. How do you secure your connection string information? 25. How do you secure your configuration files to be accessed remotely by unauthorized users? 27. 30. Does ViewState affect performance? What is the ideal size of a ViewState? How can you compress a viewstate? 14. 24. These files can then be deployed to the server. All source code files kept in the root App_Code folder must be in the same programming language. You can create a few pages in C# and a few in VB. What is XHTML? Are ASP. By setting the EnableViewStateMac to true in the @Page directive.config files can I have in an application? 31. XHTML stands for EXtensible Hypertext Markup Language and is a W3C Recommendation. Each page can be written with a different programming language in the same application. XHTML is a stricter and cleaner version of HTML.config or Web.0 Pages are XHTML compliant. This attribute checks the encoded and encrypted viewstate for tampering. Yes. SP.0 and 3. Can I deploy the application without deploying the source code on the server? 11.

Which control will you use? 46. 41. Pages developed with Visual Studio .Format- style output and the former doesn't. Can you programmatically access IIS configuration settings? 55. ASP. 50. visit this link. WMI. How do I prevent it from being overridden by another web. 48. 39.master page during the PreInit page event. and page events are individually tied to handlers. use the ‘FindControl’method of the ‘PreviousPage’ property to reference the data of the control in the first page. To change a master page.NET have this attribute set to false. Your client complains that he has a large form that collects user input. How do you exclude an ASP. the short answer is that the latter gives you String. Yes. How does Application Pools work in IIS 6. Do webservices support data reader? 49.NET Wizard Control.config and have kept it at the root level. 34. What is use of the AutoEventWireup attribute in the Page directive ? 51. By default.config file at run time? 53. follow this link 37. 56. An application pool is a group of one or more URLs that are served by a . when you run IIS 6.config file. However it does support a dataset. How do you apply Themes to an entire application? 42. No. What is Cross Page Posting? How is it done? 38.web> </configuration> 43. To remove themes from your page. What happens when you change the web. <configuration> <system. It is set to True by default for a C# web form whereas it is set as False for VB.NET page from using Themes? 44. 36.0? 57. As quoted by Scott Hanselman. 45.0 in worker process isolation mode.config that appears lower in the hierarchy? 33. use the EnableTheming attribute of the Page directive.NET invalidates the existing cache and assembles a new cache. Can you change a Master Page dynamically at runtime? How? 40. As explained under the IIS documentation. 47. By setting the element's Override attribute to false. Yes.NET submits a form to the same page. You can use ADSI. you can separate different Web applications and Web sites into groups known as application pools. Then ASP.Write and Response. He wants to break the form into sections. keeping the information in the forms related. or COM interfaces to configure IIS programmatically.web> <pages theme=”BlueMoon” /> </system.NET automatically restarts the application to apply the changes. the form is submitted to a different page. 52.Write? 35.NET forms. To learn more about this control. 32. ASP. This is done by setting the ‘PostBackUrl’ property of the button(that causes postback) to the desired page. set the MasterPageFile property to point to the . I have created a configuration setting in my web.Output. What is the difference between Response. The ASP. In the code-behind of the page to which the form has been posted. 54. To get a detailed explanation. By specifying the theme in the web. The AutoEventWireUp is a boolean attribute that allows automatic wireup of page events when this attribute is set to true on the page. In cross-page posting.

worker process or set of worker processes. Any Web directory or virtual directory can be
assigned to an application pool.
58. Every application within an application pool shares the same worker process. Because each
worker process operates as a separate instance of the worker process executable, W3wp.exe,
the worker process that services one application pool is separated from the worker process
that services another. Each separate worker process provides a process boundary so that
when an application is assigned to one application pool, problems in other application pools
do not affect the application. This ensures that if a worker process fails, it does not affect the
applications running in other application pools.
59. Use multiple application pools when you want to help ensure that applications and Web sites
are confidential and secure. For example, an enterprise organization might place its human
resources Web site and its finance Web site on the same server, but in different application
pools. Likewise, an ISP that hosts Web sites and applications for competing companies might
run each company’s Web services on the same server, but in different application pools. Using
different application pools to isolate applications helps prevent one customer from accessing,
changing, or using confidential information from another customers site.
60. In HTTP.sys, an application pool is represented by a request queue, from which the user-mode
worker processes that service an application pool collect the requests. Each pool can manage
requests for one or more unique Web applications, which you assign to the application pool
based on their URLs. Application pools, then, are essentially worker process configurations
that service groups of namespaces.
61. Multiple application pools can operate at the same time. An application, as defined by its URL,
can only be served by one application pool at any time. While one application pool is servicing
a request, you cannot route the request to another application pool. However, you can assign
applications to another application pool while the server is running.
62. Note: This ASP.NET Questions and Answers for Experienced Developers have been taken
from forums, my colleagues and my own experience of conducting interviews. I have tried to
mention the contributor wherever possible. If you would like to contribute, kindly use
the Contact form. If you think that a credit for a contribution is missing somewhere, kindly use
the same contact form and I will do the needful.

ASP.NET is a web application development framework for building web sites and web applications
that follows object oriented programming approach".

Following are the top 10 commonly asked Interview Questions with Answers on ASP.NET:

What is the concept of Postback in ASP.NET?

A postback is a request sent from a client to server from the same page user is already working with.
ASP.NET was introduced with a mechanism to post an HTTP POST request back to the same page.
It’s basically posting a complete page back to server (i.e. sending all of its data) on the same page.
So, the whole page is refreshed.

In the below diagram, when first request is made from client to server for a web page (say a simple
registration form), IsPostback property value will be false. It will be a GET request that may be
initiated by:

 typing a web page URL in a browser window or
 using JavaScript method

 or, clicking a hyperlink on a webpage page.

After user filled the returned form and presses a button (say submit button, or use JavaScript to
submit form), an HTTP Post request is made to server on same page with data as shown in point 3.
This time IsPostbackproperty value will be true. Server processes the request and returns a
response back to client.

Another concept related to this approach is "Callback" that is also asked sometimes during a
technical interview question. Click here to understand Postback Vs Callback in ASP.NET.

Difference between ASP.NET WebForms and ASP.NET MVC?

ASP.NET Web Forms uses Page controller pattern approach for rendering layout. In this approach,
every page has it's own controller, i.e., code-behind file that processes the request. On the other
hand, ASP.NET MVC uses Front Controller approach. In this approach, a common controller for all
pages, processes the requests.

Please follow for detailed information on WebForms Vs MVC.

Please briefly explain ASP.NET Page life Cycle?

ASP.NET page passes through a series of steps during its life cycle. Following is the high-level
explanation of life cycle stages/steps.

Initialization: Controls raise their Init event in this stage. Objects and variables are initializes for
complete lifecyle of request.

LoadViewState: is a post back stage and loads the view state for the controls that enabled its view
state property.

all objects associated with the request are cleaned up. Page Life Cycle is explained here. all the controls are initialized and loaded. Load: In this stage.NET related details as per Microsoft Certification Exams. In order to get other ASP.LoadPostBackData: is also a post back stage and loads the data posted for the controls and updates them. For very detailed explanation. RaisePostBackEvent: is again a postback stage. SaveViewState: Finally. Dispose: Lastly. controls state is saved in this stage before Rendering HTML. it's raise against a button click event. page as well as all the controls raise their Load event. For example. you can follow here. We can easily put our code here to perform certain actions. In most of the cases. Render: This is the stage where HTML is generated for the page. Till this stage. . we are coding this event handler.

a new request is generated from client-side for redirected page.What is the difference between custom controls and user controls? Custom controls are basically compiled code. These controls are comparatively hard to create. DLLs.NET? As in the earlier question. While in case of Server.. Hidden form fields are used to store the state of objects on client side and returned back to server in subsequent request (as postback occurs). URL remains the same in browser even after transferring to another page. For the end user. in order to maintain the state between postbacks.e. It's a kind of additional round trip. These are comparatively easy to create but tightly coupled with respect to User Interface and code. What is the concept of view state in ASP.NET web page. so the new URL is visible to user in browser after redirection. we need to copy and paste to the other project as well. ASP. In order to use across multiple projects. As new request is generated from client.Redirect. If we see the view source for an ASP. so it can be easily used across multiple projects using drag and drop approach. These can be easily added to toolbox.Transfer? In case of Response. we understood the concept of postback.NET provides a mechanism called view state. .Transfer.ascx) are just like pages (.Redirect and Server. So.aspx). a request is transferred from one page to another without making a round trip from client. i. But User Controls (. we will find that hidden form field with Id = “__VIEWSTATE” something like the following: Difference between Response.

NET? In order to validate user input. IsValid. ASP.NET Application file. EnableClientScript.  Application_Error occurs in case of an unhandled exception generated from application. Application error.  Session_Start fires when a new user session starts. Session start and end.asax:  Application_Init occurs in case of application initialization for the very first time. Please Briefly Explain the Usage of Global. There is a good list of events that are fired but following are few of the important events in Global.asax is basically an ASP. etc.Valida te().NET provides validation server controls.  Session_End fires when user session ends. Enabled.NET provides a range of validation controls: .NET or by HTTP Modules. ValidationGroup.asax? Global.  Application_Start fires on application start. It’s a place to write code for Application-level events such as Application start.  Application_End fires when application ends or time out. What are the different types of Validation controls in ASP. Application end. etc. ASP. All validation controls inherit from BaseValidator class which contains the common validation properties and methods like ControlToValidate. raised by ASP.

 Passport Authentication: validates against Microsoft Passport service which is basically a centralized authentication service.  RangeValidator validates the range. HTTP is a stateless .  Custom modes allows to define our custom storage provider.  Forms Authentication: authenticate against a customized list of users or users in a database. RequiredFieldValidator validates compulsory/required input. What are the types of Authentication in ASP.  CompareValidator validates or compares the input of a control with another control value or with a fixed value.  Off mode disables session storage.NET? ASP.NET. Naturally. State management is a technique to manage a state of an object on different request.  StateServer mode stores session state in a process other than the one where application is running.  SQLServer mode stores session state in SQL Server database. it has added advantages that session state is accessible from multiple web servers in a Web Farm and also session state will remain preserved even web application is restarted. Validates that input falls between the given range values. It has the same advantages as that of StateServer.  RegularExpressionValidator validates input value against a defined regular expression pattern. What are Session state modes in ASP.NET:  Windows Authentication: This authentication method uses built-in windows security features to authenticate user. Describe state management in ASP.NET supports different session state storage options:  In-Process is the default approach. It stores session state locally on same web server memory where the application is running.  CustomValidator allows to customize the validation logic with respect to our application logic.  ValidationSummary displays all errors on page collectively.NET? There are three types of authentication available in ASP. The HTTP protocol is the fundamental protocol of the World Wide Web.

Maintaining state is important in any web application. Query strings: In query strings. Cookies: Cookies are small piece of information that server creates on the browser. values are stored at the end of the URL. This data is presented back to the server and is available when the form is processed. Query strings are not secure.protocol means every request is from new user with respect to web server. Cookies store a value in the user’s browser that the browser sends with every page request to the web server.NET. the control state will still work. These include the following: view state: ASP.Server-side state management Explain client side state management system. control state: You can persist information about a control that is not part of the view state.NET uses view state to track values in controls between page requests. hidden fields: It stores data without displaying that control and data to the user’s browser. Explain server side state management system. . If view state is disabled for a control or the page. ASP. You cannot use view state value in next page.Client-side state management . There are two types of state management system in ASP. . Hidden fields data is available within the page only (page-scoped data). HTTP protocol does not provide you with any method of determining whether any two requests are made by the same person. It works within the page only. These values are visible to the user through his or her browser’s address bar. You should not send secret information through the query string.NET provides several techniques for storing state information on the client.

and availability. the session cookie . There are two types of cookies: Session cookies Persistent cookies. When a web server creates a cookie. Caching increases your application’s performance. scalability. After a cookie has been created on a browser. the browser sends a header that looks like this: Cookie: message=Hello Cookie is little bit of text information. whenever the browser requests a page from the same application in the future. If a user closes the web browser. You can store only string values when using a cookie. Cache Object: Caching is the process of storing data that is used frequently by the user. Explain cookies with example.NET application. an additional HTTP header is sent to the browser when a page is served to the browser.The following objects are used to store the information on the server: Application State: This object stores the data that is accessible to all pages in a given Web application. The Application object contains global variables for your ASP. A cookie is a small amount of data that server creates on the client. This object is same as application object but it stores the data about particular user. Session State: Session object stores user-specific data between individual requests. You can catch the data on the server or client. The HTTP header looks like this: Set-Cookie: message=Hello. A session cookie exists only in memory.

the cookie is stored permanently by the user’s browser on the user’s computer.Cookies are not secure.Cookies[“message”] != null) lblCookieValue. } // Here txtMsgCookie is the ID of TextBox. The above example creates a session cookie.delete permanently. then you need to specify an expiration date for the cookie.Value. If you want to create a persistent cookie. .Cookies[“message”]. on the other hand. EventArgs e) { Response. .Cookies can store small amount of data. The cookie disappears when you close your web browser. Reading Cookies void Page_Load() { if (Request. Describe the disadvantage of cookies.Cookies[“message”]. A persistent cookie.Cookie can store only string value.Text. When you create a persistent cookie. . can available for months or even years.Text = Request.Now. } // Here lblCookieValue is the ID of Label Control.Expires = DateTime. Response. Creating cookie: protected void btnAdd_Click(object sender. Cookie named message is different from setting a cookie named Message.Cookies are browser dependent.Cookies[“message”]. .Value = txtMsgCookie. Cookie names are case sensitive. .AddYears(1).

For accessing that information we have to store information. HTTP is a stateless protocol. Storing the data in Session object. It can support any type of object to store.It stores user state and data that are accessible all over the application. that data will be lost and user would not be able to retrieve the information. Advantages: . Retrieving the data from Session object.ToString(). and move to the next page.Text = Session[“message”]. Session [“message”] = “Hello World!”. Session provides that facility to store information on server memory. What are the Advantages and Disadvantages of Session? Following are the basic advantages and disadvantages of using session. it can't hold the user information on web page. If the user inserts some information. Label1. For every user.What is Session object? Describe in detail. Session data stores separately which means session is user specific. .

If you have done changes in master page. . Because in case of StateServer and SQLServer session mode we need to serialize the object before store. .NET works as a template that you can reference this page in all other content pages. Master pages in ASP.Session is secured and transparent from user because session object is stored on the server. they merge with the master page to produce output that combines the layout of the master page with the content from the content page. . Disadvantages: . because session data is stored in server memory. Describe the Master Page.Overhead involved in serializing and de-serializing session data.It is an easy mechanism to implement and it can store any kind of object.. When users request the content pages. -It stores every user data separately. then the changes will reflect in all the web pages that reference master pages.Performance overhead in case of large number of user. Master pages enable you to define the look and feel of all the pages in your site in a single location.

The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.cs" Inherits="CareerRide" %> .ContentPlaceHolder control is available only on master page. you need to define ContentPlaceHolder controls in master page as follows: <asp:ContentPlaceHolder ID=”ContentPlaceHolder1” runat=”server”> </asp:ContentPlaceHolder> The page-specific content is then put inside a Content control that points to the relevant ContentPlaceHolder: <asp:Content ID=”Content1” ContentPlaceHolderID=”ContentPlaceHolder1” Runat=”Server”> </asp:Content> Note that the ContentPlaceHolderID attribute of the Content control points to the ContentPlaceHolder that is defined in the master page. To create regions that content pages can fill in. You can use more than one ContentPlaceHolder control in master page. <%@ Master Language="C#" AutoEventWireup="true" CodeFile="CareerRide.master.

aspx. In many situations you need User’s Name in different content pages.master" %> . You can set this value inside the master page and then make it available to content pages as a property of the master page.aspx content page to reference master properties in a content page.master" AutoEventWireup="true" CodeFile="CareerRideWelcome. } set { Session ["Name"] = value.cs" Inherits="CareerRideWelcome" %> <%@ MasterTypeVirtualPath="~/CareerRide. This declaration is added just below the @ Page declaration as follows: <%@ Page Title=" TEST" Language="C#" MasterPageFile="~/CareerRide. } } Step: 2 Add the @ MasterTypedeclaration to the . Step: 1 Create a property in the master page code-behind file.How can you access the Properties and Controls of Master Pages from content pages? You can access the Properties and Controls of Master Pages from content pages. We will follow the following steps to reference the properties of master page from content pages. public String UserName { get { return (String)Session["Name"].

FindControl from the content page. For example take a label control that id is ID="Label1" Label1.Client-side navigation .UserName . Label1. What are the different method of navigation in ASP. such as clicking a hyperlink or executing JavaScript as part of a button click.NET? Page navigation means moving from one page to another page in your web site and another.Text= Master.Client-side browser redirect . call Master.FindControl("TextBox1").Text=txtName.Cross-page posting .Step: 3 Once you add the @ MasterType declaration.Client-Side Navigation Client-side navigation: Client-side navigation allows the user to navigate from one page to another by using client side code or HTML. } To reference controls in a master page. For referencing controls in the Master Page we will write the following code. There are many ways to navigate from one page to another in ASP.NET. . Example: .Text. you can reference properties in the master page using the Master class. It requests a new Web page in response to a client-side event. protected void Button1_Click(object sender. EventArgs e) { TextBox txtName= (TextBox)Master. Content Page Code.

Drag a HyperLink control on the form and set the NavigateUrl property to the desired destination page. HyperLinkControl: Source <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Welcome.aspx. and the HyperLink control is clicked. <input id="Button1" type="button" value="Go to next page" onclick="return Button1_onclick()" /> When the Button1 is clicked. the client-side method. Following is the HTML code for the input button. this control is placed on a Web page called CareerRide.aspx"> Take a test from CareerRide </asp:HyperLink> Suppose. Example: Take an HTML button control on web page.aspx page. Second method of client-side navigation is through JavaScript. The JavaScript source for the Button1_onclick method is as follows: <script language="javascript" type="text/javascript"> function Button1_onclick() { document. Button1_onclick will be called. A Button control has its PostBackUrl property. the browser simply requests the Welcome. Set this property to . The First Page has a Button and TextBox control and its ID is Button1 and TextBox1 respectively.location="NavigateTest2.aspx and Second page is SecondPage.aspx. the first page is FirstPage.aspx". } </script> Cross-page posting: Example: Suppose that we have two pages.

Client-side browser redirect: The Page. This property is only set if a cross-page post occurs.Response object contains the Redirect method that can be used in your server-side code to instruct the browser to initiate a request for another Web page. We can consider this page as the processing page.aspx").PreviousPage == null) { Label1. When the user clicks on Button.Text = "No previous page in post".PreviousPage property.Text. } else { Label1. The page that receives the PostBack receives the posted data from the firstpage for processing.Redirect ("Welcome.The processing page often needs to access data that was contained inside the initial page that collected the data and delivered the PostBack. the data will send to SecondPage for processing. EventArgs e) { if(Page. The code for SecondPage is as follows: protected void Page_Load(object sender. It is similar to the user clicking a hyperlink on a Web page. The redirect is not a PostBack.“~/SecondPage.aspx”. The previous page’s data is available inside the Page. } . } } The second page contains a Label control and its ID is Label1.Text = ((TextBox)PreviousPage._ FindControl("TextBox1")). EventArgs e) { Response. Example: protected void Button1_Click(object sender.

false). . You set this parameter to indicate if you want to keep the form and query string data. } The Transfer method has an overload that accepts a Boolean parameter called preserve- Form. EventArgs e) { Server.Transfer method is used. This happens before the web page is sent to the server.Orientation property of the Menu control sets the display of menu on a Web page to vertical or horizontal. .Transfer("MyPage. .Client-side validations are done at the client's side with the help of JavaScript and VBScript.Server-side validations occurs at the server side. The user’s address bar still reflects the name of the originally requested page. Differentiate between authentication and authorization. In this mechanism the user’s Internet address in his browser does not show the result of the transfer. Differentiate between client-side and server-side validations in web pages. Server-side transfer: In this technique Server. The Transfer method transfers the entire context of a Web page over to another page. What does the Orientation property do in a Menu control? . protected void Button1_Click(object sender.aspx". . The page that receives the transfer generates the response back to the user’s browser.In client-side browser redirect method an extra round trip to the server is happened.Originally the orientation is set to vertical.

the dependency is on a file saved in a disk while in key-based dependency. authorization will determine if he has the control over just publishing the content or also editing it. take the following steps: .config file. Example: If an employee authenticates himself with his credentials on a system.Include the <identity> element in the web. .Set the impersonate attribute to true as shown below: <identity impersonate = "true" /> Differentiate between file-based dependency and key-based dependency.Authentication is required before authorization.config file? In order to enable the impersonation in the web. Differentiate between globalization and localization. What does the . Differentiate between a page theme and a global theme? .Authentication is the process of verifying the identity of a user using some credentials like username and password while authorization determines the parts of the system to which a particular identity has access. . . . you depend on another cached item.config file.WebPart file do? It explains the settings of a Web Parts control that can be included to a specified zone on a Web page.In file-based dependency.Globalization is a technique to identify the part of a Web application that is different for different languages and separate it out from the web application while in localization you try to configure a Web application so that it can be supported for a specific language or locale. How would you enable impersonation in the web..

How do Cookies work? Give an example of their abuse.NET? . . . the Role-based security assign certain privileges to each role.An example of cookie abuse could be a case where a large cookie is stored affecting the network traffic. like button and text box.Some controls exhibit complex behavior like the controls used to connect to data sources and display data. What are Custom User Controls in ASP. All the cookies are then sent for the domain in each request. .These are the objects on ASP..Used in almost all organization. What are Web server controls in ASP.Global theme applies to all the web applications on the web server.Page theme applies to a particular web pages of the project. . are similar to the HTML controls.They are a mixture of custom behavior and predefined behavior. .Some of these Web server controls.These are the controls defined by developers and work similar to other web server controls.NET? .NET pages that run when the Web page is requested. .Each user is assigned a particular role from the list. Differentiate between a HyperLink control and a LinkButton control.The server directs the browser to put some files in a cookie.A HyperLink control does not have the Click and Command events while the LinkButton control has them. . which can be handled in the code-behind file of the Web page. . It is stored inside a subfolder of the App_Themes folder. . What is Role-based security? . It is stored inside the Themes folder on a Web server.

NET? ..It Gets or sets the discard flag set by the server. How would you turn off cookies on one page of your website? . we specify that the HTML controls act as a server control by adding the runat="server" attribute. . Session Cookie It resides on the machine of the client for a single session and works until the user logs out of the session.maxValue.To create a cookie that never expires set its Expires property equal to DateTime.This can be done by using the Cookie.When set to true. . How would you create a permanent cookie? . What are the HTML server controls in ASP. What are the various types of Cookies in ASP.Discard property. This period can be set up manually by the user. .They expose properties and events for programatical use.NET? There exist two types of cookies in ASP.To make these controls programmatically accessible. this property instructs the client application not to save the Cookie on the hard disk of the user at the end of the session. . Persistent Cookie It resides on the machine of a user for a specified period.Privileges as per role restrict the user's actions on the system and ensure that a user is able to do only what he is permitted to do on the system.NET 1.HTML server controls are similar to the standard HTML elements like those used in HTML pages. . 2. .Permanent cookies are stored on the hard disk and are available until a specified expiration date is reached.

Culture value determines the functions like Date and Currency used to format data and numbers in a Web page. .When child control send events to parent it is termed as event bubbling. Explain ASP.NET? ASP. .It checks if the value in validated control is within the specified range or not.Explain Culture and UICulture values.asax file used for? It executes application-level events and sets application-level variables. 2. RequiredFieldValidator .They are the User Interface (UI) elements which provide the desired look and feel to your web applications.NET Web Forms. . What is event bubbling? .NET provides 6 types of validation controls as listed below: 1. methods. Data List. RangeValidator .Server controls like Data grid.It is used when you do not want the container to be empty. .Web Forms are an extremely important part of ASP. It checks if the control has any value or not.Web Forms provide properties.NET. and Repeater can have other child controls inside them. and events for the controls that are placed onto them. What are the various types of validation controls provided by ASP.UICulture value determines the resources like strings or images loaded in a Web application for a Web page. . . What is Global. .

Dynamic assemblies - .).NET page. 4. . . CustomValidator . resource files etc. Differentiate between early binding and late binding. 5.Checks if the value in controls matches some specific values or not.They are not saved on disk before execution rather they run directly from memory. resources for the assembly (bitmaps. Differentiate between namespace and assembly.NET Framework types like interfaces and classes. CompareValidator .They can be saved to disk after they have been executed. Static assemblies - . 6.They are stored on disk in portable executable files.Displays summary of all current validation errors on an ASP. What are the different kinds of assemblies? There can be two types of assemblies.Checks if the value matches a specific regular expression or not. .3. Early binding means calling a non-virtual method that is decided at a compile time while Late binding refers to calling a virtual method that is decided at a runtime. RegularExpressionValidator . . JPEG files.Used to define User Defined validation. Validation Summary .It includes .Namespace is a naming convenience for logical design-time while an assembly establishes the name scope for types at run time.

Client side scripting means that the script will be executed immediately in the browser such as form field validation.Server side scripting .Structures can not have constructor or destructors while Classes can have them.It allows the state of objects to be stored in a hidden field on the page.All the script are executed by the server and interpreted as needed. Passport authentication . It is usually carried out in VBScript or JavaScript.Differentiate between Structure and Class. Forms authentication . . Forms and Passport Authentication. . etc. . Passport SDK needs to be installed to use Passport authentication in your Web application. Explain ViewState.Structures are value type while Classes are reference type. What are the various types of Authentication? There are 3 types of Authentication namely Windows.It is a . . Passport allows users to use a single identity across multiple Web applications. Explain Server-side scripting and Client-side scripting. What is garbage collection? .Net mechanism to store the posted data among post backs. email validation. .It uses the Microsoft centralized authentication provider to identify users. saved on client side and transported back to server whenever required.It uses the security features integrated in Windows NT and Windows XP OS to authenticate and authorize Web application users. . .Structures do not support Inheritance while Classes do support Inheritance. Windows authentication .It allows you to create your own list of users and validate their identity when they visit the Web site.

Serialization is the process of converting an object into a stream of bytes. 3. Out-of-Process state management needs all objects stored in session to be serializable. 2. Use the PassportAuthentication_OnAuthenticate event to access the user’s Passport profile to identify and authorize the user. 5. What are the various session state management options provided by ASP. stores an authentication cookie on the user’s computer and direct the user to the requested page. Explain serialization and deserialization. . Implement a sign-out procedure to remove Passport cookies from the user’s machine. Set authorization to deny unauthenticated users. The Passport service authenticates the user. This data source may be a SQL Server or a State Server service.Out-of-Process stores data in an external data source. .ASP. Both these processes are usually used to transport objects. ASP. . If it is not available. ASP. .It is a system where a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy.In-Process and Out-of-Process state management.config. 1. 4.NET directs the user to a Passport sign-on page. Install the Passport SDK.Deserialization is the process of creating an object from a stream of bytes. Explain the steps to be followed to use Passport authentication. . Describe how Passport authentication works. Set the application’s authentication mode to Passport in Web.NET provides two session state management options .NET? .In-Process stores the session in memory on the web server.NET application with Passport authentication implemented checks the user’s machine for a current passport authentication cookie.

Explain the advantages of Passport authentication.

- User doesn’t have to remember separate user names and passwords for various Web sites
- User can maintain his or her profile information in a single location.
- Passport authentication also avail access to various Microsoft services, such as Passport
Express Purchase.

What is caching?

- Caching is the technique of storing frequently used items in memory so that they can be
accessed more quickly.
- By caching the response, the request is served from the response already stored in
- It’s important to choose the items to cache wisely as Caching incurs overhead.
- A Web form that is frequently used and does not contain data that frequently changes is
good for caching.
- A cached web form freezes form’s server-side content and changes to that content do not
appear until the cache is refreshed.

Explain the use of duration attribute of @OutputCache page

- The @OutputCache directive’s Duration attribute determines how long the page is cached.
- If the duration attribute is set to 60 seconds, the Web form is cached for 60 seconds; the
server loads the response in memory and retains that response for 60 seconds.
- Any requests during that time receive the cached response.
- Once the cache duration has expired, the next request generates a new response and
cached for another 60 seconds.

Explain how a web application works.

A web application resides in the server and serves the client's requests over internet. The
client access the web page using browser from his machine. When a client makes a request,
it receives the result in the form of HTML which are interpreted and displayed by the browser.

A web application on the server side runs under the management of Microsoft Internet
Information Services (IIS). IIS passes the request received from client to the application. The
application returns the requested result in the form of HTML to IIS, which in turn, sends the
result to the client.

Explain the advantages of ASP.NET.

Following are the advantages of ASP.NET.

- Web application exists in compiled form on the server so the execution speed is faster as
compared to the interpreted scripts.

- ASP.NET makes development simpler and easier to maintain with an event-driven, server-
side programming model.

- Being part of .Framework, it has access to all the features of .Net Framework.

- Content and program logic are separated which reduces the inconveniences of program

- ASP.NET makes for easy deployment. There is no need to register components because
the configuration information is built-in.

- To develop program logic, a developer can choose to write their code in more than 25 .Net
languages including VB.Net, C#, JScript.Net etc.

- Introduction of view state helps in maintaining state of the controls automatically between
the postbacks events.

- ASP.NET offers built-in security features through windows authentication or other
authentication methods.

- Integrated with ADO.NET.

- Built-in caching features.

Explain the different parts that constitute ASP.NET application.

Content, program logic and configuration file constitute an ASP.NET application.

Content files
Content files include static text, images and can include elements from database.

Program logic
Program logic files exist as DLL file on the server that responds to the user actions.

Configuration file
Configuration file offers various settings that determine how the application runs on the

Describe the sequence of action takes place on the server when
ASP.NET application starts first time

Following are the sequences:

IIS starts ASP.NET worker process - worker process loads assembly in the memory - IIS
sends the request to the assembly - the assembly composes a response using program logic
- IIS returns the response to the user in the form of HTML.

Explain the components of web form in ASP.NET

Server controls
The server controls are Hypertext Markup Language (HTML) elements that include a
runat=server attribute. They provide automatic state management and server-side events and
respond to the user events by executing event handler on the server.

HTML controls
These controls also respond to the user events but the events processing happen on the

It can be private or global. it can also contain other resources like bitmaps. security. The Common language Runtime: It provides services like type safety. The . Describe in brief .Net compliant language.Net Framework has two main components: . thread management. . System components System components provide access to system-level events that occur on the server. What is an Assembly? Explain its parts.NET Framework and its components. code execution.NET Framework provides platform for developing windows and web software. ASP. .Net Framework Class Library: It provides common types such as data types and object types that can be shared by all .DLL or . Data controls Data controls allow to connect to the database. An assembly contains interface and classes. but the global assembly can be used by any application in the system. Two assemblies of the same name but with different versions can run side-by-side enabling applications that depend on a specific version to use assembly of that version. execute command and retrieve data from database. A private assembly is used only by the application to which it belongs. It carries version details which are used by the CLR during execution. An assembly exists as a . files etc. . interoperability services.client machine.NET is a part of .NET Framework sits in between our application programs and operating system. An assembly is the unit on which permissions are granted.EXE that contains MSIL code that is executed by CLR.Net framework and can access all features implemented within it that was formerly available only through windows API.

Files such as BMP or JPG file or any other files required by application.The four parts of an assembly are: Assembly Manifest . Type metadata .It contains name.exe). The page can be submitted to the server for further processing. This service of . The request is received by the IIS which then starts ASP. .Net allows developers to write program logic in at least 25 languages. A web application starts when a browser requests a page of the application first time. culture. It provides set of types that are used by all . it creates new instance of the web form. Define Common Type System. The page submitting triggers postback event that causes the browser to send the page data. The folder that has been published as virtual folder by IIS can only contain web applications.NET worker process (aspnet_wp. Resources .NET language type compatibility. Describe the Events in the Life Cycle of a Web Application. MSIL .Net is possible through CTS which ensure the rules related to data types that all language must follow.Net. The classes written in one language can be used by other languages in . The worker process then allocates a process space to the assembly and loads it. When server receives view state. The user receives the response in the form of page. An application_start event occurs followed by Session_start. version. It is the folder that contains web applications. and information about referenced assemblies. Define Virtual folder.NET languages and ensures .It contains information about types defined in the assembly. The . The request is then processed by the ASP.NET engine and sends back response in the form of HTML. also called as view state to the server.MSIL code.

The default session time is 20 minutes. as set in the application’s configuration settings. The data in the control is then available in the Page_load event of the web form. Session State Session State stores session-specific information and the information is visible within the session only. Finally all the resources of the application are reclaimed by the Garbage is then restored from the view state to the control of the web form in Page_Init event. The cached event is then handled and finally the event that caused the postback is processed.NET Following are the application event handlers: Application_Start: This event occurs when the first user visits a page of the application. What are the ways of preserving data on a Web Form in ASP.NET creates unique sessionId for each session of the application.NET? ASP. you need to save data in a state variable in the application or session objects. SessionID values are stored in a cookie. Application object stores data in the key value pair. By default. Define application state variable and session state variable. Describe the application event handlers in ASP. These objects provide two levels of scope: Application State Data stored in the application object can be shared by all the sessions of the application. When the user stops using the application. SessionIDs are maintained either by an HTTP cookie or a modified URL. Session_end event occurs and session ends. The web form is then destroyed.NET has introduced view state to preserve data between postback events. The application ends when no user accessing the application and this triggers Application_End event. ASP. To provide data to other forms. . View state can't avail data to other web form in an application.

ASP.Application_End: This event occurs when there are no more users of the application. There are three types of server control events: . Application_BeginRequest: This occurs at the beginning of each request to the server. Application_EndRequest: Occurs at the end of each request to the server. textbox. Session_End: Occurs when the users stop requesting pages and their session times out.NET? Page_Init Page_Load Page_PreRender Page_Unload Page_Disposed Page_Error Page_AbortTransaction Page_CommitTransaction Page_DataBinding Describe the Server Control Events of ASP. Session_Start: This event occurs every time when any new user visits. DropDownList etc. What are the Web Form Events available in ASP. Each control can respond to the user's actions using events and event handler mechanism.NET.NET offers many server controls like button.

IIS uses aspnet_isapi. Define namespace. You can change the session time-out setting by changing value of timeout attribute of sessionstate element in web.NET maintains process isolation for each Web application In ASP.dll to call the ASP. This is the how ASP. You can use Imports or using statement to the code file to access members of the namespaces in code.NET. Web page sends data back to the same page on the server.NET worker process (aspnet_wp. when IIS receives a request.exe). It is quite possible to have one name for an item accidentally in large projects those results into conflict.config file.NET maintains process isolation for each Web application. you reduce the chance of these conflicts. Namespaces are the way to organize programming code. Validation events These events occur just before a page is posted back to the server. The ASP. called the application domain. for each application..config file within sessionstate element.. You can create namespaces by enclosing a class in a Namespace.End Namespace block.NET worker process loads the Web application's assembly. .Postback events This events sends the web page to the server for processing. It removes the chances of name conflict. You can use namespaces outside your project by referring them using References dialog box. By organizing your code into namespaces. Cached events These events are processed when a postback event occurs. Describe how ASP. How do you change the session time-out value? The session time-out value is specified in the web. allocating one process space.

This property allows automatic retention of page and controls state between each trip to server. Session State Session State stores session-specific information and the information is visible within the session only. View State Each page and each control on the page has View State property. . Viewstate is implemented using _VIEWSTATE. you can’t rely on cookies for state management. Cookies are not good for sensitive data. This means control value is maintained between page postbacks. View State. Moreover. Cookies A cookie is a small text file on the client machine either in the client’s file system or memory of client browser session. Application object stores data in the key value pair. and Query Strings. You can’t transmit data to other page using view state. Server-side state management This kind of mechanism retains state in the server. Most browsers allow a limit of 255 characters on URL length.What are the options in ASP.NET to maintain state? Client-side state management This maintains information on the client’s machine using Cookies.NET creates unique sessionId for each session of the application. Cookies can be disabled on the browser. Querystring Query strings can maintain limited state information. Thus. ASP. Application State The data stored in the application object can be shared by all the sessions of the application. Data can be passed from one page to another with the URL but you can send limited size of data with the URL. a hidden form field which gets created automatically on each page.

as set in the application’s configuration settings. Database Database can be used to store large state information. CompareValidator: This allows checking if data of one control match with other control.SessionIDs are maintained either by an HTTP cookie or a modified URL. By default.NET? ASP. Database support is used in combination with cookies or session state.NET validation controls are: RequiredFieldValidator: This validates controls if controls contain data. RangeValidator: This verifies if entered data is between two values. What are the validation controls available in ASP. Explain the difference between Server control and HTML control. Browser detection Server controls can detect browser automatically and adapt display of control accordingly whereas HTML controls can’t detect browser automatically. SessionID values are stored in a cookie. RegularExpressionValidator: This checks if entered data matches a specific format. . Server events Server control events are handled in the server whereas HTML control events are handled in the page. Properties Server controls contain properties whereas HTML controls have attributes only. State management Server controls can maintain data across requests using view state whereas HTML controls have no such mechanism to store data between requests.

If you are using CompareValidator. What are the navigation ways between pages available in ASP. Following are the steps to set up validation control. Define authentication and authorization.Execute method 5. . Hyperlink control 2. Define the steps to set up validation control.Redirect method 3. you have to specify the ControlToCompare property. . you have to use client script using onclick="window. .NET? Ways to navigate between pages are: 1.You can use ValidationSummary control to show errors at one place. ." attribute of HTML control.Set the ControlToValidate property to the control to be validated.CustomValidator: Validate the data entered using a client-side script or a server-side code. Window. Response.Transfer method 4. . ValidationSummary: This allows developer to display errors in one place.Open script method How do you open a page in a new window? To open a page in a new window. .Drag a validation control on a web form. Server. Authorization: The process of granting access privileges to resources or tasks within an application.Specify the error message you want to display using ErrorMessage property.

It is type safe since it holds reference of only those methods that match its signature. . The cached information is used to serve subsequent requests that avoid the overhead of recreating the same information. the delegate class has a signature. In ASP. This enhances performance when same information is requested many times by the user.config file to impersonate user. Unlike other classes. Cookies are used to identity a user in a future session. What is impersonation? Impersonation means delegating one user identity to another user. Exceptions or errors are unusual occurrences that happen within the logic of an application. Define caching.Net.NET application. What is delegate? A delegate acts like a strongly type function pointer. Delegates can invoke the methods that they reference without making explicit calls to those methods. Explain Exception handling in . Caching is the technique of storing frequently used items in memory so that they can be accessed more quickly. Delegates are used to implement event programming model in . A cookie is a small file on the client computer that a web application uses to maintain current session information. Define cookie. The CLR has provided structured way to deal with exceptions using Try/Catch block.Authentication: The process of validating the identity of a user.NET supports some facilities to handling exceptions using events suck as Page_Error and Application_Error. the anonymous users impersonate the ASPNET user account by default. ASP. Caching technique allows to store/cache page output or application data on the client on the server. to be abstract. You can use <identity> element of web.NET. Delegates enable the methods that listen for an event.

NET. they are removed safely from the server using Merge modules facility. What are Merge modules? Merge modules are the deployment projects for the shared components.Example: <identity impersonate="true"/> What is managed code in . Define session in ASP. the modules merge the changes rather than unnecessarily overwrite them.Net with the introduction of managed code. The default time out for the session is 20 minutes. A session starts when the browser first request a resources from within the application. Define secured sockets layer. The versioning and registration problem which are formally handled by the windows programming are solved in . The client browse uses this encryption key to decrypt the requested Web page. When the components are no longer in use. What is Satellite assembly? Satellite assembly is a kind of assembly that includes localized resources for an application. The managed code contains all the versioning and type information that the CLR use to run the application. Secured Socket Layer (SSL) ensures a secured web application by encrypting the data sent over internet. Each satellite assembly contains the resources for one culture. . the server generates an encryption key for the session and page is encrypted before it sent. When an application is using SSL facility.Net? The code that runs under the guidance of common language runtime (CLR) is called managed code. If the components are already installed. The session gets terminated when either browser closed down or session time out has been attained.

If one of the application domains throws error it does not affect the other application domains.NET application runs. You can use trace messages to your project to monitor events in the released version of the application. List down the sequence of methods called during the page load. ASP. which still remain in the code even after when it is deployed to production servers.Loads the page in the server memory. Load() . The trace class is found in the System.the brief moment before the page is displayed to the user as HTML Unload() .Diagnostics namespace. The trace class in the code is used to diagnose problem.NET preserves data between postback events using view state.NET introduces tracing that enables you to write debug statements in your code. What is the importance of Global.Define Tracing. Define View State. If you do not want to maintain the ViewState.asax is used to implement application and session level events. . You can save a lot of coding using view state in the web form. ViewState exist for the life of the current page. It retains the state of server-side objects between postbacks. PreRender() . Every application has its own process space which isolates it from other application.asax in ASP. include the directive <%@ Page EnableViewState="false" %> at the top of an .Initializes the page. view state is maintained for each page. Tracing is the way to maintain events in an application. ASP. ViewState serialize the state of objects and store in a hidden field on the page. Init() .aspx page or add the attribute EnableViewState="false" to any control. It represents the status of the page when submitted to the server. By default. It is useful while the application is in debugging or in the testing phase. What is application domain? It is the process space within which ASP.runs just after page finishes loading.NET? The Global.

Transfer. It transfers page processing to another page without making round-trip back to the client's browser. .Discard Property when true. What is AutoPostback? AutoPostBack automatically posts the page back to the server when state of the control is changed. This performs a trip back to the client where the client’s browser is redirected to the new page.Transfer is only applicable for aspx files. it offers faster response and doesn't update client url history list. Out-of-Process Session state management stores data in an external data source such as SQL Server or a State Server service. Since no round trips.Define MSIL. Out-of-Process state management requires that all objects stored in session are serializable. Response. How to turn off cookies for a page? Cookie. Response.NET. Explain Session state management options in ASP.Net languages' executable exists as MSIL which gets converted into machine specific language using JIT compiler just before execution.Redirect vs Server. Server. In-Process stores the session in memory on the web server. MSIL is the Microsoft Intermediate Language. ASP. How can you ensure a permanent cookie? Setting Expires property to MinValue and restrict cookie to get expired. All .Redirect is used to redirect to another page or site. instructs the client application not to save the Cookie on the user's hard disk when a session ends.NET provides In-Process and Out-of-Process state management.

Step Out . VS.Error Handling . What is the use of Web.config file.Session States . .Run To Cursor .Explain login control and form authentication. Login controls encapsulate all the features offered by Forms authentication. Destructors are called in reverse order of constructors. Destructor of most derived class is called followed by its parent's destructor and so on till the topmost class in the hierarchy.Error Page setting .NET provides following option to step through code.Security .Trace setting .config file? Following are the setting you can incorporate in web. Login controls internally use FormsAuthentication class to implement security by prompting for user credentials validating them.Culture specific setting Explain in what order a destructors is called.Set Next Statement .Step Into . What is break mode? What are the options to step through code? Break mode lets you to observe code line to line in order to locate error.Step Over . .Database connections .

What is side-by-side execution? This means multiple version of same assembly to run on the same computer. If an assembly is installed to the Global Assembly Cache. Assign the result to the appropriate variable. images etc that are used by an application and deployed along with it. code access security. and cross-language accessibility. This feature enables to deploy multiple versions of the component. Explain Managed code an Un-managed code. In order to install an assembly to the GAC. use GetValue method by passing the name of the property and the type expected.Framework. Define Globalization and Localization. . Explain Global Assembly Cache. the assembly must have to be signed with strong name. Global Assembly Cache is the place holder for shared assembly. Managed code runs under the safe supervision of common language runtime. Define Resource Files. Resource files contains non-executable data like strings. Managed code carries metadata that is used by common language runtime to offer service like memory management. Unmanaged code doesn't follow CLR conventions and thus.Explain how to retrieve property settings from XML .config file. Create an instance of AppSettingsReader class. can't take the advantages of . the assembly can be accessed by multiple applications. You can changes these data without recompiling the whole application.

What is CAS? CAS is very important part of . What is reflection? Reflection is a mechanism through which types defined in the metadata of each module can be accessed. Explain the use of DataAdapter. . Each assembly of an application is the part of code group with associated permissions. .It populates the table in the dataset from the data store and also pushes the changes in the dataset back into the data store. Explain Automatic Memory Management in . They can be created using the AL utility and can be deployed even after deployment of the application.Net security system which verifies if particular piece of code is allowed to run. .Net is through garbage collector which is incredibly efficient in releasing resources when no longer in use. Automatic memory management in . The System. It also determines if piece of code have access rights to run particular resource. Satellite Assemblies are the special kinds of assemblies that exist as DLL and contain culture specific resources in a binary format. date and time format. Define Satellite Assemblies. They store compiled localized application resources.NET security system applies these features using code groups and permissions. calendar and other issues.NET. . Localization is the process of accommodating cultural differences in an application.Globalization is the process of creating multilingual application by defining culture specific features like currency.DataAdapter provides the bridge to connect command objects to a dataset object.Reflection namespaces contains classes that can be used to define the types for an assembly. Satellite Assemblies encapsulate resources into binary format and thus makes resources lighter and consume lesser space on the disk.

Populates the dataset object with data from the data source FillSchema .It is use to update the data source with the changes made to the content of the dataset What is impersonation in ASP.Dataset is handy when we need to move back while reading records. Impersonation is off <identity impersonate="true" userName="domain name\username" password="password"/> Explain the difference between dataset and datareader. . By default.Extracts the schema for a table from the data source Update .Dataset is a disconnected architecture whereas datareader is connected architecture . ASP. . Used to authenticate domain users within a network. Passport Authentication: This is based on hotmail passport account.Compare to datareader.NET? Impersonation is a technique to access application resources using the identity of some other user. using dataset has an adverse affect on speed Explain the various authentication mechanisms in ASP. . By default windows authentication is used. Form Authentication: It’s a custom security based on roles and user accounts created specifically for an application. 3. 2.NET supports 3 authentication mechanisms: 1.NET.Methods of DataAdapter: Fill .Dataset is the best choice when we need to access data from more than one table. Windows Authentication: This is used for an intranet based application. .

Returns the index of the row FindRow .NET? Usually after a user is authenticated by means of a login.Returns a collection of DataRow AddNew . There are 2 ways to authorize access to a given resource: URL authorization: URL authorization is performed by the UrlAuthorizationModule It maps users and roles to URLs in ASP. it reuses the same and existing connection object from the pool without creating a new one.aspx or . the process of authorization is followed where the decision is made whether a user should be granted access to a specific resource. When a new connection is created with same connection string as the first one. It checks the access control list of the .Deletes the specific row from DataView object What is Authorization in ASP. .NET applications. What is connection pooling and how to enable and disable connection pooling? Connection pool is created when we open connection first time.Can you explain the basic use of DataView? DataView is used for sorting and searching data within datatable.asmx handler file to determine whether a user should have access to the file.Add a new row to the DataView object Delete . File authorization: File authorization is performed by the FileAuthorizationModule. It has got following methods: Find .

COM object etc.NET? Clean up activities are entrusted to . Object Pool is a container of objects that are for use and have already been created.NET Garbage collector in . When the task of an object is done. Advantages and disadvantages of using cookies Advantages: Cookies are stored in client thus no burden as far as space is concern. Can you explain the importance of Finalize method in . Cookies are light weight and involves no complexities while using.If the connection string is different then a new connection pooling will be created. But unmanaged resources such as File. Whenever an object creation request occurs. This minimizes the memory consumption and system's resources by recycling and re-using objects. thus won't use the existing connection object. This reduces the work for garbage collector and fewer memory allocations occur. the pool manager serves the request by allocating an object from the pool. Cookies can be disabled on the client thus limiting the use of cookies. Disadvantages: Most browsers have put a check on the size of a cookie. are beyond the scope of Garbage collector.NET. set Pooling = false in the connection string. instead re using existing objects stored in memory pool. . it is sent to the pool rather than being destroyed. For these type of objects. we have connection pooling enabled in . we have Finalize method where clean up code for unmanaged resources can be put. By default. To disable connection pooling. Cookies can expire thus leading to inconsistency.Net. Cookies are tampered prone and thus associate security concern. Why is an object pool required? To enhance performance and reduce the load of creating new objects.

NET application life cycle and events processing ASP.Net Server Control vs HTML control . Next Page » ASP. ASP. .NET application life cycle .Here are the answers of interview questions on the topic ASP. ASP.NET Application and Session state variables.NET.Net Server Control vs HTML control ASP.This section covers all about ASP.NET Application and Session . ways to preserve page data.NET application life cycle and events processing ASP.NET Application and Session state variables.This article includes differences between Server Control and HTML control in ASP.