ASP.Net Interview Questions and Answers

    16 Votes

46) What is IIS? Why is it used?

Internet Information Services (IIS) is created by Microsoft to provide Internet-based services to ASP.NET Web applications. It makes your system to work as a Web server and provides the functionality to develop and deploy Web applications on the server. IIS handles the request-response cycle on the Web server. It offers the service of SMTP and front-page server extensions. As you know SMTP is used to send emails and use FrontPage server extensions to get the dynamic features of IIS, such as form handlers.

47) What you mean by Query String? What are its advantages and limitations?
The Query String helps to send the page information to the server. Advantages of Query String are -
  • All browsers works with Query Strings.
  • Query String would not not require any server resources so it does not exert any sort of burden on the server.
Limitations of Query String are -
  • Browser URL does not support many characters and it has limit.
  • Information will be visible to the user, which leads to security issues.
48) In ASP.NET how many types of cookies are there?

There are two types of cookies -
  • Session cookie - A session cookie goes away when the user shuts the browser down.
  • Persistent cookie - This resides on the hard drive of the user and is retrieved when the user comes back to the Web page.
49) What is smart navigation?
Using the Page.SmartNavigation property, we can enable smart navigation. When we set the property - Page.SmartNavigation to true, the following features are enabled for smart navigation. Scroll position of a Web page will be maintained after postback.
  • Element which focus on a Web page is maintained during navigation.
  • Most recent Web page state is only retained in the Web browser history folder.
  • Flicker effect which could occur on a Web page during navigation will be minimized.
50) Which method has been used in ASP.NET 4.0 to redirect a page permanently?

The RedirectPermanent() method used in ASP.NET 4.0 is used to redirect a page permanently. The below code snippet is an example of the RedirectPermanent() method:
RedirectPermanent("/path/Test.aspx");
51) How can you send an email message in ASP.NET?

We can use classes - MailMessage and SmtpMail, which are under namespace System.Net.Mail to send the email from our Web pages. To send an email through our mail server, we need to create an object of the SmtpClient class and set the credentials, name of server and port.

52) Explain methods Response.Write() and Response.Output.Write()?

  • Response.Write() - allows you to write the normal output.
  • Response.Output.Write()- allows you to write the formatted output.

53) What is master page in ASP.NET?

Master Page acts like a normal page. Master Pages can contain controls, code or markup as in web form. Master page will have a control called “ContentPlaceHolder”, which defines region of master page which renders HTML content of child pages which uses master page. Master pages will have extension ".master" and there will be a master directive at the top of the page as shown below -

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="TestOurSite.master.cs" Inherits=" TestOurSite " %>

54) How does the content page differ from a master page?

A content page would not be having the complete HTML source code; whereas a master page has complete HTML source code inside its source file.

55) Why do you use the App_Code folder in ASP.NET?

App_Code folder is part of ASP.NET folders. It stores any type of objects like text files, classes or reports. Advantage of App_Code folder is that if multiple classes or objects been added into this folder it creates a single dll for all.

56) What is tracing? Where is it used?

Tracing displays the details about the code execution. It is meant for getting the details of application when it is in running mode, which is really useful for troubleshooting the application. It gives an option to log the details to a file. So from the file it’s easy to figure out the root cause for an issue. .NET supports Trace Listeners, which gets the trace output and it is used to store the information in different places.

57) What is the timeout of Cookie?

The default time for a Cookie to expire is 30 minutes.

58) What are modes of Session state in ASP.NET?

  • In-Process – It stores the session in local system.
  • State Server – It stores the session in a process called “ASP.NET state service”.
  • SQLServer – It stores the session in SQL Server database.
  • Custom – It allows the custom storage provider.

59) Which namespace is used to implement debug and trace methods?

Namespace used for both these methods – “System.Diagnostic”.

60) What are the difference between Web server and Web Service?

  • Web Server is the one which gives the response to all the requests of the clients. Client can use either HTTP, SOAP protocols for request. Web Server is a computer and it turns to be a server once server software is installed. Every Web Server will have its domain possibly.
  • Web Services are one of the components of Web Server which is callable from client side. Client will call the Web Service by making HTTP or SOAP requests. ASP.NET allows to create a custom Web Services which is in turn called from client side.

61) How would you enable automatic paging in DataGrid ?

Below are the list of points which are to be followed in order to enable paging in Datagrid –

  • Set the “AllowPaging” to true.
  • Set the current page index to clicked in PageIndexChanged event.
Page 4 of 10

Popular Videos

communication

How to improve your Interview, Salary Negotiation, Communication & Presentation Skills.

Got a tip or Question?
Let us know

Related Articles

C# Interview Questions
.Net Framework Interview Questions and Answers
ADO.Net Interview Questions and Answers for Freshers, Experienced
ASP.Net MVC Interview questions and Answers
WCF Interview Questions and Answers
ASP.Net Web API Interview Questions
Top 50 Entity framework interview questions & answers