keyboard_arrow_up

ASP.Net Interview Questions and Answers

 Interview Questions and Answers



ASP.NET is the new ASP generation. It is does not fit with Classic ASP

ASP.NET pages have the .aspx extension


When a browser requests an ASP.NET file, the ASP.NET engine reads the file, compiles and executes the words in the file, and returns the result to the browser as plain HTML.

ASP.NET is a development frame for building web pages and web sites with HTML, CSS, JavaScript and server scripting.

ASP.NET supports three different development models:

Web Pages,Model View Controller and Web Forms.

1. What is ASP?

Active Server Pages is a Microsoft’s server-side technology, which helps in developing dynamic and user-friendly Web pages.

2. Define ASP.Net.

It is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting.

3. ASP.net advantages?

ASP.Net advantage over ASP :

Compiled Code

Language Support

Strict Coding needs

Event-Driven Programming Model

3rd Party Controls

User Authentication

Easier Configuration & Deployment

Object and Page Caching

Higher Scalability

4. How to maintain session in ASP.NET?

In-process storage.

Session State Service.

Microsoft SQL Server.

In-Process Storage

The default location is the ASP.NET process itself.

Session State Service

It is an alternative to using in-process storage for session state. ASP.NET provides the ASP.NET State Service. The State Service gives you an alternative for storing session state that is not tied quite so closely to ASP. Net’s own process.

Microsoft SQL Server

It is the final choice for storing state information.

5. What is the difference between Server.Transfer and Response.Redirect?

Server.Transfer() : The client sees it as on the requesting page , but all the content is of the requested page.

Response.Dedirect() : Here the client know the physical location (page name and query string as well).

6. Types of comments in asp.net

Single line comments

// for single line comments

Multiple line comments

/* for multi line comments */

XML tags comments

/// XML tags depicted in a code comment

7. Use of @RenderPage() method

@RenderPage() method is used to bring content from separate files.

Example:

<html>

<body>

@RenderPage(“header.cshtml”)

<h1>Hello Web Pages</h1>

<p>This is a paragraph</p>

@RenderPage(“footer.cshtml”)

</body>

</html>

8.What is the folder structure of ASP.NET Web Pages

Logical Folder Structure

Below is a basic folder structure for an ASP.NET web page:

Folders

The “Account” folder has log on and security files

The “App_Data” folder has databases and data files

The “Images” folder has images

The “Scripts” folder has browser scripts

The “Shared” folder has common files

Physical folder structure

Below is a basic folder structure for image

C:\user\Documents\MyWebSites\Demo\Images

From the example above:

The virtual name of a web picture might be “Images/pic31.jpg”.

But the physical name is “C:\usere\Documents\MyWebSites\Demo\Images\pic31.jpg”

URLs and Paths

URLs are to access files from the web: http://www.demo.com/html/html5_intro.asp %>

9. Difference between globalization and localization

Globalization is the process of creating a software product that functions in multiple locales.

Localization is the way of adapting a globalized application, which you have already processed in a localized way, to a particular locale.

10. Define ViewState.

It is the method that the ASP.NET page frame utilize to preserve page and control values between

round trips. When the HTML markup for the page is given, the current state of the page and values that

must be kept during post back are arranged into base64-encoded strings.

11. Name the methods used to force all the validation controls to run

Page.Validate() method

12. What is the difference between Response.Write() and Response.Output.Write() methods?

Response.write() doesn’t give output in format. The latter one helps you to give output in format

Response.write – it writes the text stream , whereas Response.output.write – it writes the HTTP Output Stream.

13. Define Cookie

A cookie is used to identify a user. It is a small file that the server implants on the user’s computer. Each time the same PC requests a page with a browser, it will send the cookie also. With ASP, one can both create and retrieve cookie values.

14. How to Create a Cookie?

The “Response.Cookies” is used to create cookies.

N.B. The command Response.Cookies must appear BEFORE the <html> tag.

In the below example, we are creating a cookie named “fname” and give it the value “ABC” :

<%

Response.Cookies(“fname”)=”ABC”

Response.Cookies(“fname”).Expires=#Jan 10,2015#

15. How to recover a Cookie Value?

The command “Request.Cookies” is used to recover a cookie value.

Example:

<%

firstname=Request.Cookies(“fname”)

response.write(“Firstname=” & firstname)

%>

More questions would be coming next.

We are updating our list of question and answers on .NET

If you are considering to undergo ASP.Net training then our CRB Tech .Net Training center would be very helpful in fulfilling your aspirations. We update ourself with the ongoing generation and that is being portrayed in our ASP.Net course.

Stay connected to this page of CRB Tech reviews for more technical up-gradation and other resources.

CRB Tech reviews will continue to enlighten you with such technical articles on .NET.



CRB Tech reviews will continue to enlighten you with such technical articles on .NET.

Related Articles:

Next Generation Asp.net vNext

PHP VS ASP.NET