Popular Posts

Saturday, 17 August 2013

Greeting everyone....
Lets start with some basic but knowledgeable question on asp.net

1. What does the Orientation property do in a Menu control?

Orientation property of the Menu control sets the display of menu on a Web page to vertical or horizontal.
Originally the orientation is set to vertical.

2. Differentiate between:

a.)Client-side and server-side validations in Web pages.

- Client-side validations happens at the client's side with the help of JavaScript and Vb-script. This happens before the Web page is sent to the server.
- Server-side validations occurs place at the server side.

b.)Authentication and authorization.

- 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.
- Authentication is required before authorization.

For e.g. If an employee authenticates himself with his credentials on a system, authorization will determine if he has the control over just publishing the content or also editing it.

3.a.) What does the .Web Part file do?
It explains the settings of a Web Parts control that can be included to a specified zone on a Web page.

b.) How would you enable impersonation in the web.config file?

In order to enable the impersonation in the web.confing file, take the following steps:
- Include the <identity> element in the web.config file.
- Set the impersonate attribute to true as shown below:
<identity impersonate = "true" />

4. a.) Differentiate between

a.)File-based dependency and key-based dependency.

- In file-based dependency, the dependency is on a file saved in a disk while in key-based dependency, you depend on another cached item.

b.) Globalization and localization.

- 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.

5. a.)Differentiate between a page theme and a global theme?

- Page theme applies to a particular web pages of the project. It is stored inside a subfolder of the App_Themes folder.
- Global theme applies to all the web applications on the web server. It is stored inside the Themes folder on a Web server.

b.)What are Web server controls in ASP.NET?

- These are the objects on ASP.NET pages that run when the Web page is requested.
- Some of these Web server controls, like button and text box, are similar to the HTML controls.
- Some controls exhibit complex behavior like the controls used to connect to data sources and display data.

6. a.) Differentiate between a HyperLink control and a LinkButton control.

- 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.

b.) How do Cookies work? Give an example of their abuse.

- The server directs the browser to put some files in a cookie. All the cookies are then sent for the domain in each request.
- An example of cookie abuse could be a case where a large cookie is stored affecting the network traffic.

7. a.) What are Custom User Controls in ASP.NET?

- These are the controls defined by developers and work similart to other web server controls.
- They are a mixture of custom behavior and predefined behavior.

b.) What is Role-based security?

- Used in almost all organization, the Role-based security assign certain privileges to each role.
- Each user is assigned a particular role from the list.
- 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.

8. What are the HTML server controls in ASP.NET?

- HTML server controls are similar to the standard HTML elements like those used in HTML pages.
- They expose properties and events for programatical use.
- To make these controls programmatically accessible, we specify that the HTML controls act as a server control by adding the runat="server" attribute.

9. a.) What are the various types of Cookies in ASP.NET?

There exist two types of cookies in ASP.NET

- Session Cookie - It resides on the machine of the client for a single session and works until the user logs out of the session.
- Persistent Cookie - It resides on the machine of a user for a specified period. This period can be set up manually by the user.

b.) How would you turn off cookies on one page of your website?

- This can be done by using the Cookie.Discard property.
- It Gets or sets the discard flag set by the server.
- When set to true, this property instructs the client application not to save the Cookie on the hard disk of the user at the end of the session.

c.) How would you create a permanent cookie?

- Permanent cookies are stored on the hard disk and are available until a specified expiration date is reached.
- To create a cookie that never expires set its Expires property equal to DateTime.maxValue.

10. a.) Explain Culture and UICulture values.

- Culture value determines the functions like Date and Currency used to format data and numbers in a Web page.
- UICulture value determines the resources like strings or images loaded in a Web application for a Web page.

b.) What is Global.asax file used for?

It executes application-level events and sets application-level variables.

11. a.) Explain ASP.NET Web Forms.

- Web Forms are an extremely important part of ASP.NET.
- They are the User Interface (UI) elements which provide the desired look and feel to your web applications.
- Web Forms provide properties, methods, and events for the controls that are placed onto them.

b.) What is event bubbling?

- When child control send events to parent it is termed as event bubbling.
- Server controls like Data grid, Data List, and Repeater can have other child controls inside them.

12. What are the various types of validation controls provided by ASP.NET?

ASP.NET provides 6 types of validation controls as listed below:

i.) RequiredFieldValidator - It is used when you do not want the container to be empty. It checks if the control has any value or not.

ii.) RangeValidator - It checks if the value in validated control is within the specified range or not.

iii.) CompareValidator - Checks if the value in controls matches some specific values or not.

iv.) RegularExpressionValidator - Checks if the value matches a specific regular expression or not.

v.) CustomValidator - Used to define User Defined validation.

vi.) Validation Summary -Displays summary of all current validation errors on an ASP.NET page.

13. Differentiate between:

a.) Namespace and Assembly.

- Namespace is a naming convenience for logical design-time while an assembly establishes the name scope for types at run time.

b.) Early binding and late binding.

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.

14. What are the different kinds of assemblies?

There can be two types of assemblies.

i.) Static assemblies -

- They are stored on disk in portable executable files.
- It includes .NET Framework types like interfaces and classes, resources for the assembly (bitmaps, JPEG files, resource files etc.).

ii.) Dynamic assemblies -

- They are not saved on disk before execution rather they run directly from memory.
- They can be saved to disk after they have been executed.

15. Differentiate between Structure and Class.

- Structures are value type while Classes are reference type.
- Structures can not have constructor or destructors while Classes can have them.
- Structures do not support Inheritance while Classes do support Inheritance.

16. Explain ViewState.

- It is a .Net mechanism to store the posted data among post backs.
- It allows the state of objects to be stored in a hidden field on the page, saved on client side and transported back to server whenever required.

17. What are the various types of Authentication?

There are 3 types of Authentication namely Windows, Forms and Passport Authentication.

- Windows authentication - It uses the security features integrated in Windows NT and Windows XP OS to authenticate and authorize Web application users.

- Forms authentication - It allows you to create your own list of users and validate their identity when they visit the Web site.

- Passport authentication - It uses the Microsoft centralized authentication provider to identify users. Passport allows users to use a single identity across multiple Web applications. Passport SDK needs to be installed to use Passport authentication in your Web application.

18. Explain Server-side scripting and Client-side scripting.

- Server side scripting - All the script are executed by the server and interpreted as needed.
- Client side scripting means that the script will be executed immediately in the browser such as form field validation, email validation, etc. It is usaullay carrried out in VBScript or JavaScript.

19. a.) What is garbage collection?

It is a system where a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy.

b.) Explain serialization and deserialization.

- Serialization is the process of converting an object into a stream of bytes.
- Deserialization is the process of creating an object from a stream of bytes.

Both these processes are usually used to transport objects.

20. What are the various session state management options provided by ASP.NET?

- ASP.NET provides two session state management options - In-Process and Out-of-Process state management.
- In-Process stores the session in memory on the web server.
- Out-of-Process stores data in an external data source. This data source may be a SQL Server or a State Server service. Out-of-Process state management needs all objects stored in session to be serializable.
ASP.NET interview questions - Jan 04, 2011 at 05:16 PM by  Rahul

Describe how Passport authentication works.

ASP.NET application with Passport authentication implemented checks the user’s machine for a current passport authentication cookie. If it is not available, ASP.NET directs the user to a Passport sign-on page. The Passport service authenticates the user, stores an authentication cookie on the user’s computer and direct the user to the requested page.

Explain the steps to be followed to use Passport authentication.

1. Install the Passport SDK.
2. Set the application’s authentication mode to Passport in Web.config.
3. Set authorization to deny unauthenticated users.
3. Use the PassportAuthentication_OnAuthenticate event to access the user’s Passport profile to identify and authorize the user.
4. Implement a sign-out procedure to remove Passport cookies from the user’s machine.

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 memory.
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. 

No comments :

Post a Comment