Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Ajax Timer control in asp.net

Answer»

Below is example of a Timer control. We can use timer control in AJAX. We take a example of datetime how to display time.

Html code for webpage:-
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html XMLNS="http://www.w3.org/1999/xhtml" >
< head runat="server" >
< title >Untitled Page< /title >
< /head >
< body >
< form id="form1" runat="server" >
< div >
< ASP:ScriptManager ID="ScriptManager1" runat="server" >
< /asp:ScriptManager >
< /div >
< asp:UPDATEPANEL ID="UpdatePanel1" runat="server" >
< ContentTemplate >
< asp:Label ID="Label1" runat="server" > < /asp:Label >
< /ContentTemplate >
< Triggers >
< asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" / >
< /Triggers >
< /asp:UpdatePanel >
< asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick1" Interval="60" >
< /asp:Timer >
< /form >
< /body >
< /html >

Code Behind Form is as Below:-
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Timer1_Tick1(object sender, EventArgs e)
{
Label1.Text = System.DateTime.Now.ToString();
}
}

2.

Code to retrieve xml data from ajax

Answer»

Below code will HELP us to GET data from XML file wth the AJAX code quite easily and in simple WAY





xmlajax

3.

syntax of updatepanel in ajax

Answer»

here is the DETAIL Below

4.

What is UpdatePanel and its uses and disadvantage

Answer»

UpdatePanel control is very important control in the ASP.NET. Which comes in AJAX package. It will helps us to do partial rendering of the page. And this control mainly have TWO childtags
(1)ContentTemplate
(2)Triggers TAGS.
ContentTemplate helps to holds the content of the panel. Here content can be of any type which we put on our page and this can be literal text to web controls etc.
But triggers tag allows us to define certain triggers which will make the panel to update contents on it.
where to Use UpdatePanel
(1)WebPage have less asp.net controls and less VIEWSTATE.
(2)WebPage html is not too big.
(3)The time is limited to finish the task.
(4)Where performance is not too concern.
(5)WANT to keep the sate of controls with postbacks.
(6)Have a lot of server side events you want to fire.

Below are some common disadvantage or limitaion of update panel
(1)Viewstate is still here so bandwidth as same as before updatepanel is used
(2)Exception handling is little complex here
(3)Outside button cannot do so much freedom as inner button in updatepanel

5.

How many update panel we can have per page in ASP.NET

Answer»

There is no LIMIT on NUMBER of UPDATE PANEL

6.

Syntax of AJAX autocomplete extender

Answer»

< div ID="divwidth" >
< ajaxToolkit:AUTOCOMPLETEEXTENDER runat="server"
ID="AutoCompleteExtender1"
BehaviorID="autoComplete"
TargetControlID="txtAutoComplete"
ServicePath="AutoComplete.asmx"
ServiceMethod="GetCompletionList"
MINIMUMPREFIXLENGTH="1"
CompletionInterval="10"
EnableCaching="TRUE"
CompletionSetCount="12"
CompletionListCssClass="AutoExtenderCSS"
CompletionListItemCssClass="AutoExtenderList"
CompletionListHighlightedItemCssClass
="AutoExtenderHighlight"
CompletionListElementID="divwidth" >
< ajaxToolkit:AutoCompleteExtender >
< /div >