Some Important ASP.NET Questions

There are some questions which is very much important in Web development as per the point of developer in asp.net. However they do exist on other lists available on the internet so I felt compelled to keep then here for easy access.

  • What is the role of inetinfo.exe, aspnet_isapi.dll and aspnet_wp.exe at the time page loading process?

inetinfo.exe is the Microsoft IIS server running which handles Web development ASP.NET requests among other things. When an ASP.NET received a request, the ISAPI filter aspnet_isapi.dll take care of it through passing the Web development request to the actual worker process aspnet_wp.exe.

  • What’s the difference among Response.Write () and Response.Output.Write ()?

Response.Write () allow simple to display simple output while Response.Output.Write () allows you to write formatted output.

  • At the time of page load what methods are fired?

The different methods which are fired during the page load
Init () event is fired when the page is first instantiated
Load () event is fired when the page is loaded into server memory
PreRender () event is fired when the brief moment before the page is Web development displayed to the user as HTML
Unload () event is fired when page finishes loading.

  • When during the page processing cycle is ViewState available?

ViewState is available after the Init () and before the Page_Load (), or OnLoad () for a control.

  • What namespace does the Web page belong in the .NET Framework class hierarchy?

System.Web.UI.Page, is the namespace belong in the .NET Framework class hierarchy?

  • Where do you store the information about the user’s locale?

The information is stored in about users locale is System.Web.UI.Page.Culture

  • What’s the difference between Codebehind=”MyCode.aspx.cs” and Src=”MyCode.aspx.cs”?

CodeBehind is relevant to Visual Studio.NET only.

  • What do understand by a bubbled event?

When you have a complex control, such as DataGrid, writing an event of Web development processing routine for each object such as cell, button, row, column etc. is quite tough. The Web development controls can bubble up their event handlers, permitting the main DataGrid event handler to take care of its constituents.

  • Suppose you want a certain ASP.NET function executed on Mouse Over for a certain button. Where do you add an event handler?

Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add (“onmouseover”,”some Client Code Here () ;”);

  • What data types does the RangeValidator control support?

Data types that Rangevalidator control supports are Integer, String, and Date.

  • What are the differences among Server-side and Client-side code?

The main difference in between Server-side and client-side are that Server-side code executes on the server while Client-side code executes in the client’s browser.

  • What type of code (server or client) is found in a Code-Behind class?

Server-side code since code-behind is executed on the server.It can render client-side code like JavaScript to be Web development processed in the client’s browser. But just to be clear, code-behind executes on the server therefore making it server side code.

  • Should user input data validation occur server-side or client-side? Why?

All user input data validation must take place on the server at a minimum time of interval. Moreover, client-side validation can be carried out where believed proper and feasible to give a richer, more responsive Web development experience for the user.

  • How Server.Transfer and Response.Redirect differ from each other? Why would I decide one over the other?

Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client’s browser which helps to provide a faster response with a little less overhead on the server. Server.Transfer does not update the client url history list or current url. Response.Redirect is used to redirect the user’s browser to another page or site. This performs a trip back to the client where the client’s browser is Web development redirected to the new page. The user’s browser history list is updated to reflect the new address.

  • What is the difference among an ADO.NET Dataset and an ADO Recordset?


Difference between an ADO.NET Dataset and an ADO Recordset are:

·A DataSet can represent whole relational database in memory with all tables, relations, and views.
·A DataSet is build to work in disconnected mode from the database.
·Data in a DataSet is bulk-loaded, rather than being loaded on demand.
·Dataset has no concept of cursor types in a DataSet.
·Datasets have no current record pointer you can use For Each loops to move through the data.
·The most important Web development is that lots of edited data can be stored in a DataSet, and update them to the original data source in a single operation.
·Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

  • What is the Global.asax used for?

The Global.asax is utilized to implement Web development application and session level events.

  • What Are the Application_Start and Session_Start subroutines used for?

This is where developer can set the particular variables for the Application and Session objects.

  • What do you mean by inheritance and an example of when you might use it?

Inheritance is the properties to inherit from another class. For example with abase class named Employee, a Manager class could be derived from the Employee base class.

  • What’s MSIL, and why should my developers need an appreciation of it if at all?

MSIL is the Microsoft Intermediate Language. The entire .NET compatible languages will get converted to MSIL. MSIL also permits the .NET Framework to Just run time (JIT) compiles the assembly on the installed computer.

  • What method do you invoke on the DataAdapter control to load your generated dataset with data?

The Fill () method.

  • What’s an assembly?

Assemblies are known as the building blocks of the .NET framework.

  • What is the difference between inline and code behind?

Inline is the code written along side the html in a page and Code-behind is the code written in a separate file and referenced by the .aspx page.

  • What is a diffgram, use of it?

The DiffGram is one of the two XML formats which you can use to render DataSet object contents to XML.A good Web development utilization is reading database data to an XML file to be sent to a Web Service.

  • What base class do all Web Forms inherit from?

The Page class.

  • Can you edit data in the Repeater control?

No, it just reads the information from its data source.

  • What property must you set, and what method must you call in your code, in order to bind the data from adata source to the Repeater control?

You must set the DataSource property and call the DataBind method.

  • What template you will provide to display data in a Repeater control?

For displaying data in repeater control ItemTemplate is used.

  • What are the common properties in every validation control?

The common properties in every validation control are ControlToValidate property and Text property.

  • How can you provide an alternating color scheme in a Repeater control?

Use the AlternatingItemTemplate.

  • Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

DataTextField property.

  • Name the control which is used to make sure the values in two different controls matched?

CompareValidator control.

  • How many classes can a single .NET DLL contain?

It can contain many classes.

Some Important Web Service Questions are illustrated below:

  • Which transport protocol is used to call a Web service?
  • SOAP(Simple Object Access Protocol) is the preferred protocol.
  • True or False: A Web service can only be written in .NET?
  • False
  • What does WSDL stand for?
  • Web Services Description Language.
  • True or False: To test a Web service you must create a Windows application or Web application to consume this service?
  • False, the web service comes with a test page and it provides HTTP-GET method to test.

State Management Questions

  • What is ViewState?

ViewState permits the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external Web development source. ViewState is utilized keep the state of server-side objects among postabacks.

  • What is the lifespan for items stored in ViewState?

Lifespan Item stored in ViewState exist for only life of the current page. This comprises postbacks.

  • What does the “EnableViewState” property do? Why would I want it on or off?

It permits the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState which are stored as a hidden value on the page before sending the page to the client’s Web development browser.When the page is posted back to the server the server control is reconstructed with the state stored in viewstate

  • Name different kinds of Session state management options available with ASP.NET?

ASP.NET gives In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server, for this it requires a “sticky-server”, therefore the user is at all times reconnected to the same web server. While Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management needs which the entire objects stored in session are serializable in Web development .