ASP.NET AJAX Interview Questions – Part I

Abstract: The ASP.NET AJAX Interview Questions contains the most frequently asked questions in ASP.NET AJAX. These lists of questions will gauge your familiarity with the ASP.NET AJAX platform.

ASP.NET AJAX Interview Questions – Part I

The ASP.NET AJAX Interview Questions contains the most frequently asked questions in ASP.NET AJAX. These lists of questions will gauge your familiarity with the ASP.NET AJAX platform.

What is Ajax?

The term Ajax was coined by Jesse James Garrett and is a short form for "Asynchronous Javascript and XML". Ajax represents a set of commonly used techniques, like HTML/XHTML, CSS, Document Object Model(DOM), XML/XSLT, Javascript and the XMLHttpRequest object, to create RIA's (Rich Internet Applications).

Ajax gives the user, the ability to dynamically and asynchronously interact with a web server, without using a plug-in or without compromising on the user’s ability to interact with the page. This is possible due to an object found in browsers called the XMLHttpRequest object.

What is ASP.NET AJAX?

‘ASP.NET AJAX’ is a terminology coined by Microsoft for ‘their’ implementation of AJAX, which is a set of extensions to ASP.NET. These components allow you to build rich AJAX enabled web applications, which consists of both server side and client side libraries.

Which is the current version of ASP.NET AJAX Control Toolkit?

As of this writing, the toolkit version is Version 1.0.20229 (if you are targeting Framework 2.0, ASP.NET AJAX 1.0 and Visual Studio 2005) and Version 3.0.20229 (if targeting .NET Framework 3.5 and Visual Studio 2008).

What role does the ScriptManager play?

The ScriptManager manages all ASP.NET AJAX resources on a page and renders the links for the ASP.NET AJAX client libraries, which lets you use AJAX functionality like PageMethods, UpdatePanels etc. It creates the PageRequestManager and Application objects, which are prominent in raising events during the client life cycle of an ASP.NET AJAX Web page. It also helps you create proxies to call web services asynchronously.

Can we use multiple ScriptManager on a page?

No. You can use only one ScriptManager on a page.

What is the role of a ScriptManagerProxy?

A page can contain only one ScriptManager control. If you have a Master-Content page scenario in your application and the MasterPage contains a ScriptManager control, then you can use the ScriptManagerProxy control to add scripts to content pages.

Also, if you come across a scenario where only a few pages in your application need to register to a script or a web service, then its best to remove them from the ScriptManager control and add them to individual pages, by using the ScriptManagerProxy control. That is because if you added the scripts using the ScriptManager on the Master Page, then these items will be downloaded on each page that derives from the MasterPage, even if they are not needed, which would lead to a waste of resources.

What are the requirements to run ASP.NET AJAX applications on a server?

You would need to install ‘ASP.NET AJAX Extensions’ on your server. If you are using the ASP.NET AJAX Control toolkit, then you would also need to add the AjaxControlToolkit.dll in the /Bin folder.

Note: ASP.NET AJAX 1.0 was available as a separate downloadable add-on for ASP.NET 2.0. With ASP.NET 3.5, the AJAX components have been integrated into ASP.NET.

Explain the UpdatePanel?

The UpdatePanel enables you to add AJAX functionality to existing ASP.NET applications. It can be used to update content in a page by using Partial-page rendering. By using Partial-page rendering, you can refresh only a selected part of the page instead of refreshing the whole page with a postback.

Can I use ASP.NET AJAX with any other technology apart from ASP.NET?

To answer this question, check out this example of using ASP.NET AJAX with PHP, to demonstrate running ASP.NET AJAX outside of ASP.NET. Client-Side ASP.NET AJAX framework can be used with PHP and Coldfusion.

ASP.NET AJAX contains both a server-side Ajax framework and a client-side Ajax framework. The server-side framework provides developers with an easy way to implement Ajax functionality, without having to possess much knowledge of JavaScript. The framework includes server controls and components and the drag and drop functionality. This framework is usually preferred when you need to quickly ajaxify an asp.net application. The disadvantage is that you still need a round trip to the server to perform a client-side action.

The Client-Side Framework allows you to build web applications with rich user-interactivity as that of a desktop application. It contains a set of JavaScript libraries, which is independent from ASP.NET. The library is getting rich in functionality with every new build released.

How can you debug ASP.NET AJAX applications?

Explain about two tools useful for debugging: Fiddler for IE and Firebug for Mozilla.

Yes, you can do that. You would want to nest update panels to basically have more control over the Page Refresh.

How can you to add JavaScript to a page when performing an asynchronous postback?

Use the ScriptManager class. This class contains several methods like the RegisterStartupScript(), RegisterClientScriptBlock(), RegisterClientScriptInclude(), RegisterArrayDeclaration(),RegisterClientScriptResource(), RegisterExpandoAttribute(), RegisterOnSubmitStatement() which helps to add javascript while performing an asynchronous postback.

Explain differences between the page execution lifecycle of an ASP.NET page and an ASP.NET AJAX page?

In an asynchronous model, all the server side events occur, as they do in a synchronous model. The Microsoft AJAX Library also raises client side events. However when the page is rendered, asynchronous postback renders only the contents of the update panel, where as in a synchronous postback, the entire page is recreated and sent back to the browser.

Is the ASP.NET AJAX Control Toolkit(AjaxControlToolkit.dll) installed in the Global Assembly Cache?

No. You must copy the AjaxControlToolkit.dll assembly to the /Bin folder in your application.

Those were some frequently asked questions you should have knowledge about. In one of the coming articles, we will cover some more ASP.NET AJAX FAQ’s which were not covered in this article. I hope this article was useful and I thank you for viewing it.

Suprotim has received the prestigious Microsoft MVP award for nine times in a row now. In a professional capacity, he is the CEO of A2Z Knowledge Visuals Pvt Ltd, a digital group that represents premium web sites and digital publications comprising of Professional web, windows, mobile and cloud developers, technical managers, and architects.

its a niceful and beautiful knowledge based article . got a chance to know abt ajax in depth. continue ur journey to share ur knowledge with us.
a once again i m very thankful to for this knowledhe plenty conatiner

Comment posted by
Satya
on Sunday, September 14, 2008 10:37 AM

I have gone through all Q&A really this material is good and most useful for me.
Great job dude!
It was really useful.
thanks a lot.
Regards,
satya

Comment posted by
Deepti
on Monday, October 13, 2008 9:02 AM

Gr8 articles which provide knowledge and are useful to all the professionals

Comment posted by
jsip123
on Sunday, October 19, 2008 7:06 AM

I really like this website. It provides me lot of information on .Net.
This site contains easy ways to collect required information.
This site is really a very helpfull to clarify doubts.
Thank You very much.

i see all the information its very useful please send lot of information about .net(c#,vb,asp)

Comment posted by
ilakkia
on Tuesday, January 6, 2009 10:00 AM

i see all the information its very useful please send lot of information about .net(c#,vb,asp)

Comment posted by
Irfan
on Thursday, January 8, 2009 11:55 PM

very nice..

Comment posted by
guru
on Monday, January 12, 2009 6:18 AM

Really good collection.this is very useful for us.could u send ajax mini projects.once again thanks a lot.
guru

Comment posted by
pramod
on Wednesday, January 14, 2009 1:07 PM

It's a very good collection, I like this collection.............keep on

Comment posted by
Bharat Sisode
on Thursday, January 22, 2009 2:07 AM

Very Nice question set realy usefull

Comment posted by
sdf
on Friday, February 27, 2009 7:07 AM

sdf

Comment posted by
Ravi
on Monday, March 2, 2009 11:23 PM

this is very good question.

Comment posted by
radhey Shaym
on Tuesday, March 17, 2009 7:22 AM

fundoo........

Comment posted by
Arun
on Wednesday, April 22, 2009 10:19 AM

It's very nice collections.
Thanks
Arun

Comment posted by
Prerak Shah
on Thursday, April 30, 2009 9:49 PM

Nice collection... Thanks :)

Comment posted by
janees
on Tuesday, May 12, 2009 12:23 AM

It's better in the best for asp.net ajax beginners.i am really thankful to authoer to get a kind idea about AJAX

Comment posted by
Anandu4u
on Friday, May 22, 2009 7:58 AM

Great..............
Thanks

Comment posted by
Shuaib Kaniyar
on Tuesday, June 2, 2009 3:28 AM

good collection...

Comment posted by
Mukesh
on Saturday, June 20, 2009 1:01 PM

Thanks...good questions

Comment posted by
vijai
on Tuesday, July 7, 2009 5:57 AM

Nice example ....

Comment posted by
rajkumar
on Monday, July 27, 2009 5:56 AM

very good question....keep update with latest questions

Comment posted by
johnson
on Tuesday, July 28, 2009 12:39 PM

Thanks...good example

Comment posted by
ja
on Tuesday, October 20, 2009 1:34 AM

very nice, here is another series of interview QAs
http://jack-fx.com/csharp/post/aspnet-interview-questions-and-answers-csharp.htm
http://jack-fx.com/csharp/post/38-interview-questions-and-answers-of-aspnet.htm
http://jack-fx.com/csharp/post/c-interview-questions-and-answers.htm

Comment posted by
rahul
on Wednesday, December 23, 2009 4:49 AM

First of all. Thanks very much for your useful post.

I just came across your blog and wanted to drop you a note telling you how impressed I was with the

information you have posted here.

Please let me introduce you some info related to this post and I hope that it is useful for community.