ASP.NET Programming Questions & Answers

Explore model answers categorized by subjects like Java, HTML, DBMS, and more.

ASP.NET Programming Questions & Answers

How to Add an AJAX Extender Control?

Answer:
The ASP.NET AJAX Control Toolkit includes several extender controls that can be used to enhance the client functionality of Web server controls. Before you add an extender control to a server control in the following procedure, you must install the ASP.NET AJAX Toolkit. You can download the Control Toolkit from the “ASP.NET AJAX Control Toolkit” Web site.
1.Switch to Design view.
2.If the page does not already contain a ScriptManager control, from the AJAX Extensions tab of the Toolbox, drag one onto the page.
3.From the Standard tab of the Toolbox, drag a Button control onto the page.
4.If the Common Button Tasks shortcut menu does not appear, right-click the Button control and then click Show Smart Tag.
5.On the Common Button Tasks menu, click Add Extender.
6.In the Extender Wizard, in the Choose the functionality to add to Button1 list, click ConfirmButtonExtender, and then click OK. 
7.In the Properties window, expand the Extenders tab, and then expand Button1_ConfirmButtonExtender.
8.Set the ConfirmText property to Continue?

What is AJAX ?

Answer:
AJAX(Asynchronous JavaScript And XML) is not a new programming language, but a new way to use existing standards. AJAX is the art of exchanging data with a server, and update parts of a web page without reloading the whole page. The main purpose of Ajax is to provide a simple and standard means for a web page to communicate with the server without a complete page refresh.

How to create an AJAX website using Visual Studio?

Answer:
Steps: Start Visual Studio, 
Click on File -> New Website -> Under Visual Studio Installed templates -> Select ASP.NET Ajax-Enabled Site. Enter a location & select OK. 

If using Visual Studio 2008 Web Developer Express Ajax comes along with it (so no need of a separate installation).Using Visual Studio Web Developer Express 2005 & versions above it, Ajax based applications may easily be created. Note that the Ajax Framework & Ajax Extensions should be installed (In case of VS 2005).

What is the ASP.NET Ajax Framework?

Answer:
ASP.NET AJAX is a free framework to implement Ajax in asp.net web applications, for quickly creating efficient and interactive Web applications that work across all popular browsers.
The Ajax Framework is powered with
1 - Reusable Ajax Controls
2 - Support for all modern browsers
3 - Access remote services and data from the browser without tons of complicated script.

What role does the ScriptManager play?

Answer:
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.
The ScriptManager control (that we may drag on a web form) is actually an instance of the ScriptManager class that we put on a web page. The ScriptManager manages all the ASP.NET Ajax controls on a web page. 
Using ScriptManager class:
1 - All resources managing on a web page.
2 - Partial page updates
3 - Interact with UpdatePanel Control. 
4 - Information Release whether.
5 - Provied Facility to access Web Services Method
6 - Providing access to ASP.NET authentication role.

What are limitations of Ajax?

Answer:
1.If the network bandwidth is slow,end user confused because no page postback full running. 
2.Distributed applications running Ajax will need a central mechanism for communicating with each other 

What is the role of a ScriptManagerProxy?

Answer:
In case of Master 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.A page can contain only one ScriptManager control.
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 is an UpdatePanel Control?

Answer:
All controls residing inside the UpdatePanel will be partial postbacked.An UpdatePanel control is a holder for server side controls that need to be partial postbacked in an ajax cycle.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.

What is the name of AJAX controls ?

Answer:
There are 5  AJAX controls.
1. ScriptManager
2. UpdatePanel
3. UpdateProgress
4. Timer
5. ScriptManageProxy

What is ASP.NET AJAX?

Answer:
ASP.NET AJAX is a terminology by Microsoft for 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.

Define Internet Standards for AJAX?

Answer:
AJAX is based on internet standards, and uses a combination of:
1. XMLHttpRequest object (to exchange data asynchronously with a server)
2. JavaScript/DOM (to display/interact with the information)
3. CSS (to style the data)
4. XML (often used as the format for transferring data)

What is XMLHttpRequest object in AJAX?

Answer:
The XMLHttpRequest object is used to exchange data with a server. With the XMLHttpRequest object Browser can retrieve and submit XML data directly to a Web server without reloading the page. To convert XML data into renderable HTML content, use the client-side Extensible Stylesheet Language Transformations (XSLT) to compose HTML elements for presentation.

Property:
1. Onreadystatechange 
2. readyState
3. responseBody 
4. responseTextresponseXML
5. StatusstatusText

Method
1. abort  
2. getAllResponseHeaders: 	
3. getResponseHeader	 	
4. open 				
5. send 			

Why Use ASP.NET AJAX Features?

Answer:
Features:
1. Improved efficiency.
2. As user requirement significant parts of a Web page's processing are performed in the browser.
3. UI elements- progress indicators, tool tips, and pop-up windows.
4. Partial-page updates that refresh only the parts of the Web page that have changed.
5. Client integration with ASP.NET application services for forms authentication, roles, and user profiles.
6. Auto-generated proxy classes.
7. Provide a framework that lets you customize of server controls to include client capabilities.

Define ASP.NET AJAX Client Life-Cycle Events?

Answer:
The two main Microsoft AJAX Library classes that raise events during the client life cycle of a page:
1. Application and
2. PageRequestManager classes.
When partial-page rendering with UpdatePanel controls is enabled, the key client events are the events of the PageRequestManager class. These events enable you to handle many common scenarios. These include the ability to cancel postbacks, to give precedence to one postback over another, and to animate UpdatePanel controls when their content is refreshed.

1. Sys.WebForms.PageRequestManager Events:

initializeRequest: Raised during initialization of an asynchronous postback.
beginRequest: Raised before processing of an asynchronous postback starts, 
pageLoading: Raised after a response to an asynchronous postback is received from the server, but before any content on the page is updated.
pageLoaded: Raised after all content on the page is refreshed as the result of either a synchronous or an asynchronous postback.
endRequest: Use this event to provide customized error notification to users or to log errors. 

2. Sys.Application Events:

init: Raised only once when the page is first rendered after all scripts have been loaded, but before objects are created.
load: Raised after all scripts have been loaded and objects in the application have been created and initialized.
unload: Raised before all objects in the client application are disposed.

How to Check Whether AJAX Functionality is Enabled for a Page?

Answer:
Use the following code to determine whether AJAX functionality is enabled for a page in C# Code:

ScriptManager sm = ScriptManager.GetCurrent(Page)
if (sm == null)
{
    // ASP.NET AJAX functionality is not enabled for the page.
}
else
{
    // AJAX functionality is enabled for the page.
}
To determine whether partial page rendering is supported for a page, you can modify this code to use the EnablePartialRendering and the SupportsPartialRendering property of the ScriptManager control.

How to Remove an AJAX Extender Control in ASP.NET?

Answer:
If the functionality of an extender control is no longer needed, you can remove the extender control.
1.Switch to Design view.
2.Select the Button control, and then on the Common Button Tasks menu, click Remove Extender.
3.In the Extenders attached to Button1 list, select ConfirmButtonExtender.
4.Click Remove, and then click OK.

What is the ASP.NET AJAX Extender Controls?

Answer:
If you want to adds client functionality to a Button control when users confirm to submit a form to the server then extender controls can use. ASP.NET AJAX extender controls enhance the client capabilities of standard ASP.NET Web server controls such as TextBox controls, Button controls, and Panel controls by using one or more extender controls to provide a richer user experience in the browser, and you also add ASP.NET AJAX extender controls to Visual Studio and work with them as you do with other controls. You can create your own extender controls and source for extender controls is the ASP.NET AJAX Control Toolkit.

What are the features of ASP.NET AJAX Extender Controls

Answer:
Visual Studio supports the following extender control features:
1.Adding extender controls.
2.Removing extender controls.
3.Setting extender control properties.
4.Managing extender controls

List of all Extender Controls in the AJAX Control Toolktit?

Answer:
Extender Controls in the AJAX Control Toolktit:
1.CascadingDropDown
2.CollapsiblePanelExtender
3.ConfirmButtonExtender
4.FilteredTextBoxExtender
5.ModalPopupExtender
6.PasswordStrength
7.RoundedCornersExtender
8.TextBoxWatermarkExtender

Define Classes in ASP.NET AJAX Extender Controls?

Answer:
Two classes:
1.ExtenderControl: 
The ExtenderControl class enabled to programmatically add AJAX functionality to an ASP.NET server control and inherits from the Control class and implements the IExtenderControl interface. The Control class defines the properties, methods, and events that are shared by all ASP.NET server controls.

Inheritance Hierarchy:
System.Object
  System.Web.UI..::.Control
   System.Web.UI.ExtenderControl

2.IExtenderControl: The ExtenderControl base class performs an explicit test to make sure that a ScriptManager control exists on the page. However, if you want to create extender controls and the page does not contain an ScriptManager control, you can create a class that implements the IExtenderControl interface directly. 

Inheritance Hierarchy:
System.Object
  System.Web.UI.Control
    System.Web.UI.IExtenderControl

What is the Debug Helper Classes in AJAX ASP.NET?

Answer:
ASP.NET provides the Sys.Debug class for debugging client applications. By calling methods of the Sys.Debug class, you can display objects in readable form at the end of the page, show trace messages, use assertions, and break into the debugger. 

The following table lists the methods of the Sys.Debug class.

Sys.Debug.assert(condition, message, displayCaller): 
Checks for a condition, and if the condition is false, displays a message and prompts the user to break into the debugger.

Sys.Debug.clearTrace():
Clears all trace messages from the TraceConsoletextarea element.

Sys.Debug.traceDump(object, name): 
Dumps an object to the debugger console and to the TraceConsoletextarea element, if available.

Sys.Debug.fail(message): 
Displays a message in the debugger's output window and breaks into the debugger.

Sys.Debug.trace(text): 
Appends a text line to the debugger console and to the TraceConsoletextarea element, if available.

What is AJAX Server Controls in ASP.NET?

Answer:
ASP.NET Web server controls that enable you to add AJAX functionality to an ASP.NET Web page. AJAX functionality includes refreshing parts of a page with a partial-page update and therefore avoiding a full-page postback.

1. ScriptManager Control Overview:
Manages client script for AJAX-enabled ASP.NET pages
2. Timer Control Overview:
Performs postbacks at defined intervals.
3. UpdatePanel Control Overview:
Enables you to refresh selected parts of the page instead of refreshing the whole page with a postback. 
4. UpdateProgress Control Overview:
Enables you to provide status information about partial-page updates in UpdatePanel controls.

What is Timer control in AJAX ASP.NET?

Answer:
The ASP.NET AJAX Timer control performs postbacks at defined intervals. If Timer control used with an UpdatePanel control, you can enable partial-page updates at a defined interval. You can also use the Timer control to post the whole page.

You use the Timer control when you want to do the following:
1. Periodically update the contents of one or more UpdatePanel controls without refreshing the whole Web page.
2. Run code on the server every time that a Timer control causes a postback.
3. Synchronously post the whole Web page to the Web server at defined intervals

How to use a Timer Control inside an UpdatePanel Control in AJAX ASP.NET?

Answer:
For Timer controls inside an UpdatePanel control, the JavaScript timing component is re-created only when each postback finishes. Therefore, the timed interval does not start until the page returns from the postback. For instance, if the Interval property is set to 60,000 milliseconds (60 seconds) but the postback takes 3 seconds to complete, the next postback will occur 63 seconds after the previous postback. When the Timer control is included inside an UpdatePanel control, the Timer control automatically works as a trigger for the UpdatePanel control.
The following example shows how to include a Timer control inside an UpdatePanel control: 


  
    
    
  

How to use a Timer Control outside an UpdatePanel Control in AJAX ASP.NET?

Answer:
: If the Timer controls are outside an UpdatePanel control, the JavaScript timing component continues to run as the postback is being processed. For example, if the Interval property is set to 60,000 milliseconds (60 seconds) and the postback takes 3 seconds to complete, the next postback will occur 60 seconds after the previous postback. The user will see the refreshed content in the UpdatePanel control for only 57 seconds.

The following example shows how to use the Timer control outside an UpdatePanel control:




  
    
    
    
      
  

What is Custom Component Properties in AJAX ASP.NET?

Answer:
When creating a client component class, define the properties that expected page developers to access. Also raise Sys.Component.propertyChanged notification events in the set accessors for properties of your component. Page developers who use the component can bind the property notification event to their own handler to run code when the property value changes.

Defining Public Properties in a Custom Client Component in AJAX ASP.NET?

Answer:
In ASP.NET AJAXclient components, property accessors are defined as methods of the class prototype. The accessor methods are named with get_ and set_ prefixes followed by the property name. The following example shows how to define a read-write property named interval in the class prototype.

get_interval: function() 
{
    return this._interval;
},
set_interval: function(value)
 {
    this._interval = value;
}

How to raise a PropertyChanged Event in AJAX ASP.NET?

Answer:
Invoking to the Sys.Component raisePropertyChanged method in a property set accessor to raise a propertyChanged event. Your component inherits the raisePropertyChanged method from the Sys.Component, Sys.UI.Behavior, or Sys.UI.Control base class.

The following example shows how to raise a propertyChanged event for an interval property whenever the property is set.

get_interval: function()
 {
    return this._interval;
},
set_interval: function(value) 
{
    if (this._interval !== value) 
{
        this._interval = value;
        this.raisePropertyChanged('interval');
    }
}

How to Globalize and Localize client script files in AJAX ASP.NET?

Answer:
The ScriptManager control enables you to globalize and localize client script files. Globalization lets you use the Date and Number JavaScript type extensions in your script and have those objects display values that are based on the current culture. Localization lets you provide client script files for different cultures.

How to Configure SMTP in asp .NET?

Answer:

This example specifies SMTP parameters to send e-mail using a remote SMTP server and user  that are importent. This program shows configuration process-

<system.net>

<mailSettings>

<smtp 

deliveryMethod=\"Network|PickupDirectoryFromIis|SpecifiedPickupDirec>

<network 

defaultCredentials=\"true|false\"

from=\"r4r@fco.in\"

host=\"smtphost\"

port=\"26\"

password=\"password\"

userName=\"user\"/>

<specifiedPickupDirectory 

pickupDirectoryLocation=\"c:pickupDirectory\"/>

</smtp>

</mailSettings>

</system.net>

Print Hello World message using SharePoint in Asp.Net 2.0?

Answer:

using System;

using System.Collections.Generic;

using System.Text;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using Microsoft.SharePoint.WebPartPages;

namespace LoisAndClark.WPLibrary

{

public class MYWP : WebPart

{

protected override void CreateChildControls()

{

Content obj = new Content();

string str1 = obj.MyContent<string>(\"Hello World!\");

this.Controls.Add(new System.Web.UI.LiteralControl(str1));

}

}

}

 generic method shows that  SharePoint site is  running on .NET Framework

2.0, and the code of the generic method seems like this:

public string MyContent<MyType>(MyType arg)

{

return arg.ToString();

}

How to create a SharePoint web part using File upload control.give example?

Answer:

using System;

using System.Collections.Generic;

using System.Text;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using Microsoft.SharePoint.WebPartPages;

namespace LoisAndClark.WPLibrary

{

public class MYWP : WebPart

{

FileUpload objFileUpload = new FileUpload();

protected override void CreateChildControls()

{

this.Controls.Add(new System.Web.UI.LiteralControl

(\"Select a file to upload:\"));

this.Controls.Add(objFileUpload);

Button btnUpload = new Button();

btnUpload.Text = \"Save File\";

this.Load += new System.EventHandler(btnUpload_Click);

this.Controls.Add(btnUpload);

}

private void btnUpload_Click(object sender, EventArgs e)

{

string strSavePath = @\"C:temp\";

if (objFileUpload.HasFile)

{

string strFileName = objFileUpload.FileName;

strSavePath += strFileName;

objFileUpload.SaveAs(strSavePath);

}

else

{

//otherwise let the message show file was not uploaded.

}

}

}

}

What is BulletedList Control in Share Point. Give an example?

Answer:

Bullet style allow u choose the style of the element that precedes the item.here u can choose numbers, squares, or circles.here child items can be rendered as plain text, hyperlinks, or buttons.

This example uses a custom image that requires to be placed in a virtual directory on the server.

using System;

using System.Collections.Generic;

using System.Text;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using Microsoft.SharePoint.WebPartPages;

namespace LoisAndClark.WPLibrary

{

public class MyWP : WebPart

{

protected override void CreateChildControls

 {

BulletedList objBullist = new BulletedList();

objBullist.BulletStyle = BulletStyle.CustomImage;

objBullist.BulletImageUrl = @\"/_layouts/images/rajesh.gif\";

objBullist.Items.Add(\"First\");

objBullist.Items.Add(\"Seciond\");

objBullist.Items.Add(\"Third\");

objBullist.Items.Add(\"Fourth\");

this.Controls.Add(objBullist);

}

}

}

DescribeWizard server control with example in Share Point?

Answer:

This control enables you to build a sequence of steps that are displayed to the

end users side. It is alos used either display or gather information in small steps in system.

using System;

using System.Collections.Generic;

using System.Text;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using Microsoft.SharePoint.WebPartPages;

namespace LoisAndClark.WPLibrary

{

public class MyWP : WebPart

{

protected override void CreateChildControls()

{

Wizard objWizard = new Wizard();

objWizard.HeaderText = \"Wizard Header\";

for (int i = 1; i <= 6; i++)

{

WizardStepBase objStep = new WizardStep();

objStep.ID = \"Step\" + i;

objStep.Title = \"Step \" + i;

TextBox objText = new TextBox();

objText.ID = \"Text\" + i;

objText.Text = \"Value for step \" + i;

objStep.Controls.Add(objText);

objWizard.WizardSteps.Add(objStep);

}

this.Controls.Add(objWizard);

}

}

Define Life Cycle of Page in ASP.NET?

Answer:

    protected void Page_PreLoad(object sender, EventArgs e)

    {

        Response.Write(\"<br>\"+\"Page Pre Load\");

    }

    protected void Page_Load(object sender, EventArgs e)

    {

        Response.Write(\"<br>\" + \"Page Load\"); 

    }

    protected void Page_LoadComplete(object sender, EventArgs e)

    {

        Response.Write(\"<br>\" + \"Page Complete\");

    }

    protected void Page_PreRender(object sender, EventArgs e)

    {

        Response.Write(\"<br>\" + \"Page Pre Render\");

    }

    protected void Page_Render(object sender, EventArgs e)

    {

        Response.Write(\"<br>\" + \"Pre Render\");

    }

    protected void Page_PreInit(object sender, EventArgs e)

    {

        Response.Write(\"<br>\" + \"Page Pre Init\");

    }

    protected void Page_Init(object sender, EventArgs e)

    {

        Response.Write(\"<br>\" + \"Page Init\");

    }

    protected void Page_InitComplete(object sender, EventArgs e)

    {

        Response.Write(\"<br>\" + \"Page Pre Init Complete\");

    }


Write a program in ASP.NET to Show Data With Access?

Answer:

Page_Load():-

    OleDbConnection x;

    OleDbCommand y;

    OleDbDataReader z;

    protected void Page_Load(object sender, EventArgs e)

    {

        x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\");

        x.Open();

        y = new OleDbCommand(\"select * from emp\", x);

        z = y.ExecuteReader();

        while (z.Read())

        {

            Response.Write(z[\"ename\"]);

            Response.Write(\"<hr>\");  

        }

        z.Close();

        y.Dispose(); 

        x.Close(); 

    }


Write a program to show connection with Oracle in ASP.NET?

Answer:

    OleDbConnection x;

    OleDbCommand y;

    OleDbDataReader z;

    protected void Page_Load(object sender, EventArgs e)

    {

        x = new OleDbConnection(\"provider=msdaora;user id=scott;password=tiger\");

        x.Open();

        y = new OleDbCommand(\"select * from emp\", x);

        z = y.ExecuteReader();

        while (z.Read())

        {

            Response.Write(\"<li>\");

            Response.Write(z[\"ename\"]);

        }    

        z.Close();

        y.Dispose(); 

        x.Close(); 

    }


Write a program to show connection to Excel in ASP.NET?

Answer:

OleDbConnection x;

    OleDbCommand y;

    OleDbDataReader z;

    protected void Page_Load(object sender, EventArgs e)

    {

        x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\book1.xls;Extended Properties=excel 8.0\");

        x.Open();

        y = new OleDbCommand(\"select * from [sheet1$]\", x);

        z = y.ExecuteReader();

        while (z.Read())

        {

            Response.Write(\"<li>\");

            Response.Write(z[\"ename\"]);

        }    

        z.Close();

        y.Dispose(); 

        x.Close(); 

    }


How to add Record in ASP.NET?

Answer:

OleDbConnection x;

    OleDbCommand y;

    protected void Button1_Click(object sender, EventArgs e)

    {

        x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\");

        x.Open();

        y = new OleDbCommand(\"Insert into emp(empno,ename,sal) values(@p,@q,@r)\", x);

        y.Parameters.Add(\"@p\", TextBox1.Text);

        y.Parameters.Add(\"@q\", TextBox2.Text);

        y.Parameters.Add(\"@r\", TextBox3.Text);

        y.ExecuteNonQuery();

        Label1.Visible = true;   

        Label1.Text=\"Record Addedd\";

        y.Dispose();

        x.Close(); 

     }


Write a program to Delete Record in ASP.NET ?

Answer:

OleDbConnection x;

    OleDbCommand y;

     protected void Button1_Click(object sender, EventArgs e)

    {

        x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\");

        x.Open();

        y = new OleDbCommand(\"delete from emp where empno=@p\",x);

        y.Parameters.Add(\"@p\", TextBox1.Text);

        y.ExecuteNonQuery();

        Label1.Visible = true;   

        Label1.Text=\"Record Deleted\";

        y.Dispose();

        x.Close(); 

 }

Write a program to show data in Gridview in ASP.NET?

Answer:

    OleDbConnection x;

    OleDbDataAdapter y;

    DataSet z;

    protected void Button2_Click(object sender, EventArgs e)

    {

        x = new OleDbConnection(\"provider=msdaora;user id=scott;password=tiger\");

        x.Open();

        y = new OleDbDataAdapter(\"select * from emp\", x);

        z = new DataSet();

        y.Fill(z, \"emp\");

        GridView1.DataSource = z.Tables[\"emp\"];

        GridView1.DataBind();  

        y.Dispose();

        x.Close(); 

    }

Write a Program to Connect with dropdownlist in ASP.NET

Answer:

OleDbConnection x;

    OleDbDataAdapter y;

    DataSet z;

    protected void Button1_Click(object sender, EventArgs e)

    {

        x = new OleDbConnection(\"Provider=msdaora;user         id=scott;password=tiger\");

        x.Open();

        y=new OleDbDataAdapter(\"select * from emp\",x);

        z = new DataSet();

        y.Fill(z, \"emp\");

        DropDownList1.DataSource = z;

        DropDownList1.DataTextField = \"ename\"; 

        DropDownList1.DataBind();

        x.Close();  

 

    }

How Repeater is used in ASP.NET?

Answer:

<asp:Repeater ID=\"Repeater1\" runat=\"server\"> <ItemTemplate>

                            <%#DataBinder.Eval(Container.DataItem, \"Empno\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Ename\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Sal\") %>

 </ItemTemplate> 

 </asp:Repeater>

//the whole structure looks like this

<asp:Repeater ID=\"Repeater1\" runat=\"server\">

<HeaderTemplate>

 Employee Detailed

</HeaderTemplate> 

            <ItemTemplate>

               <font color=gray>

                            <%#DataBinder.Eval(Container.DataItem, \"Empno\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Ename\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Sal\") %>

                </font> 

                </ItemTemplate> 

                <AlternatingItemTemplate>

                <font color=green>

                            <%#DataBinder.Eval(Container.DataItem, \"Empno\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Ename\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Sal\") %>

                 </font> 

                  </AlternatingItemTemplate>

                 <FooterTemplate>

                       Thanks

                </FooterTemplate> 

               <SeparatorTemplate>

                        <hr/>

                </SeparatorTemplate> 

                </asp:Repeater>

How to show data in HTML table using Repeater?

Answer:

<asp:Repeater ID=\"Repeater1\" runat=\"server\">

                    <HeaderTemplate>

                    <table border=\"10\" width=\"100%\"  bgcolor=green  style=\"width:100%\" >

                       <tr>

                       <th>Empno</th> <th>Ename</th> <th>Sal</th>  

                       </tr>

                    </HeaderTemplate> 

                    <ItemTemplate>

                            <tr>

                            <td>

                            <%#DataBinder.Eval(Container.DataItem, \"Empno\") %>

                            </td>

                            <td>

                            <%#DataBinder.Eval(Container.DataItem, \"Ename\") %>

                            </td>

                            <td>

                            <%#DataBinder.Eval(Container.DataItem, \"Sal\") %>

                            </td>

                            </tr>

                            </font> 

                    </ItemTemplate> 

                    <FooterTemplate>

                       </table> 

                    </FooterTemplate> 

                    </asp:Repeater>

                </td>

                <td style=\"width: 100px; height: 226px\">

                </td>

            </tr>

        </table>

Write a program to show the Use of dataList in ASP.NET?

Answer:

<asp:DataList ID=\"DataList1\" runat=\"server\" BackColor=\"White\" BorderColor=\"#336666\" BorderStyle=\"Double\" BorderWidth=\"3px\" CellPadding=\"4\" GridLines=\"Both\">

        <HeaderTemplate>Employee Detailed</HeaderTemplate>  

        <ItemTemplate>

                            <%#DataBinder.Eval(Container.DataItem, \"Empno\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Ename\") %>

                            <%#DataBinder.Eval(Container.DataItem, \"Sal\") %>

        </ItemTemplate>    

How to make User Control in ASP.net?

Answer:

a) Add User Controll

write code:-

<hr color=red/>

<center><H1><SPAN 

style=\"COLOR: #ff9999; TEXT-DECORATION: underline\">BigBanyanTree.com</SPAN></H1></center> 

<hr Color=Green/>


b) In .aspx page:-

<%@ Register TagPrefix=a TagName=\"MyUserCtl\" Src=\"~/WebUserControl.ascx\"%>


c) Now use this :-

<a:MyUserCtl ID=\"tata\" runat=server/>

What is Benefits of ASP.NET?

Answer:

>>Simplified development

ASP.NET offers a very rich object model that developers can use to reduce the amount of code they need to write.

>>Web services:

Create Web services that can be consumed by any client that understands HTTP and

XML,  the de facto language for inter-device communication.

>>Performance:

When ASP.NET page is first requested, it is compiled and cached, or saved in memory, by

the .NET Common Language Runtime (CLR). This cached copy can then be re-used for

each subsequent request for the page. Performance is thereby improved because after

the first request, the code can run from a much faster compiled version.

>>Language independence

>>Simplified deployment

>>Cross-client capability

How does cookies work in ASP.Net?

Answer:

Using Cookies in web pages is very useful for temporarily storing small amounts of data, for the website to use. These Cookies are small text files that are stored on the user\'s computer, which the web site can read for information; a web site can also write new cookies.

An example of using cookies efficiently would be for a web site to tell if a user has already logged in. The login information can be stored in a cookie on the user\'s computer and read at any time by the web site to see if the user is currently logged in. This enables the web site to display information based upon the user\'s current status - logged in or logged out. 

Difference Between Thread and Processs?

Answer:

Process is a program in execution where thread is a seprate part of execution in the program.

Thread is a part of process. process is the collection of thread. 

What is the difference between an EXE and a DLL?

Answer:

DLL: Its a Dynamic Link Library .There are many entry points. The system loads a DLL into the context of an existing thread. Dll cannot Run on its own

EXE: Exe Can Run On its own.exe is a executable file.When a system launches new exe, a new process is created.The entry thread is called in context of main thread of that process.

         


Difference bt ASP and asp.net?

Answer:
1.Asp .net is compiled while asp is interpreted.
2.ASP is mostly written using VB Script and HTML. while asp .net can be written in C#, J# and VB etc.
3.Asp .net have 4 built in classes session , application , request response, while asp .net have more than 2000 built in classes.
4.ASP does not have any server side components whereas Asp .net have server side components such as Button , Text Box etc.
5.Asp does not have page level transaction while Asp .net have page level transaction.
ASP .NET pages only support one language on a single page, while Asp support multiple language on a single page.
6.Page functions must be declared as 


    Set Cookie Values


    









Define Error Events in Asp.Net?

Answer:

In ASP.Net when any unhandled exception accurs in application then an event occures,that event called Error event.Two types of Event:

1. Page_Error:When exception occures in a page then this event raised.

2. Application_error:Application_Error event raised when unhandled exceptions in the ASP.NET application and is implemented in global.asax.

The error event have two method:

1. GetLastError: Returns the last exception that occurred on the server.

2. ClearError: This method clear error and thus stop the error to trigger subsequent error event.


Why the exception handling is important for an application?

Answer:
Exception handling prevents the unusual error in the asp.net application,when apllication executed.If the exceptions are handled properly, the application will never get terminated abruptly.

Explain the aim of using EnableViewState property?

Answer:
When the page is posted back to the server, the server control is recreated with the state stored in viewstate.It allows the page to save the users input on a form across postbacks. It saves all the server side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. 

What are the two levels of variable supported by Asp.net?

Answer:

1. Page level variable:String ,int ,float.

2. Object level variable:Session level, Application level.

Difference between Session object and Profile object in ASP.NET?

Answer:

Profile object:

1. Profile object is persistent.

2. Its uses the provider model to store information.

3. Strongly typed

4. Anonymous users used mostly.


Session object:

1. Session object is non-persistant.

2. Session object uses the In Proc, Out Of Process or SQL Server Mode to store information.

3. Not strongly typed.

4. Only allowed for authenticated users.

What is the Default Expiration Period For Session and Cookies,and maximum size of viewstate?

Answer:

The default Expiration Period for Session is 20 minutes.

The default Expiration Period for Cookie is 30 minutes.

The maximum size of the viewstate is 25% of the page size

What is the use of Global.asax File in ASP.NET Application ?

Answer:

The Global.asax file, can be stored in root directory and accesible for web-sites,is an optional file.This Global.asax file contained in HttpApplicationClass.we can declare global variables like variables used in master pages because these variables can be used for different pages right.Importent feature is that its provides more security in comparision to other.

It handle two event:

1.Application-level  

2.Session-level events.


Global.asax File itself configured but it can not be accessed.while one request is in processing it is impossible to send another request, we can not get response for other request and even we can not start a new session.

while adding this Global.asax file to our application by default it contains five methods,

Those methods are:

1.Application_Start.

2.Application_End.

3.Session_Start.

4.Session_End.

5.Application_Error.

What is the Purpose of System.Collections.Generic ?

Answer:
For more safty and better performance strongly typed collections are useful for the user. System.Collections.Generic having interfaces and classes which define strongly typed generic collections.

What is GAC and name of the utility used to add an assembly into the GAC ?

Answer:

GAC(Global Assembly Cache) for an effective sharing of assemblies.GAC refers to the machine-wide code cache in any of the computers that have been installed with common language runtime.Global Assembly Cache in .NET Framework acts as the central place for private registering assemblies.

\"gacutil.exe\" utility used to add assembly in GAC

Whether we can use vbscript and javascript combination for validation?

Answer:
WE cant use them togather,since compiler are different.

What are the different states in ASP.NET?

Answer:

There are three types of state:

1. View state: Under the client-side state managment.The ViewState property provides a dictionary object for retaining values between multiple requests for the same page. When an ASP.NET page is processed, the current state of the page and controls is hashed into a string and saved in the page as a hidden field. 

2. Application state:Under the server side state managment. ASP.NET allows you to save values using application state, a global storage mechanism that is accessible from all pages in the Web application. Application state is stored in the Application key/value dictionary.

3. Session state:Under server side state managment . ASP.NET allows you to save values using session state, a storage mechanism that is accessible from all pages requested by a single Web browser session.

Define State managment?

Answer:

This is passible to at a time many request occures.State management is the process by which maintained state and page information over multiple requests for the same or different pages.

Two types of State Managment:

1. Client side state managment:This stores information on the client\'s computer by embedding the information into a Web page,uniform resource locator(url), or a cookie.

2. Server side state managment: There are two state Application State,Session State. 

What is Authentication and Authorization ?

Answer:

An authentication system is how you identify yourself to the computer. The goal behind an authentication system is to verify that the user is actually who they say they are.

Once the system knows who the user is through authentication, authorization is how the system decides what the user can do.

Discribe Client Side State Management?

Answer:

Client side state managment have:

a. Stores information on the client\'s computer by embedding the information into a Web page.

b. A uniform resource locator(url).

c. Cookie.

To store the state information at the client end terms are:

1. View State:It is used by the Asp.net page framework to automatically save the values of the page and of each control just prior to rendering to the page.Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state.

2. Control State:When user create a custom control that requires view state to work properly, you should use control state to ensure other developers dont break your control by disabling view state.

3. Hidden fields:Like view state, hidden fields store data in an HTML form without displaying it in the user\'s browser. The data is available only when the form is processed.

4. Cookies: Cookies store a value in the user\'s browser that the browser sends with every page request to the same server. Cookies are the best way to store state data that must be available for multiple Web pages on a web site.

5. Query Strings: Query strings store values in the URL that are visible to the user. Use query strings when you want a user to be able to e-mail or instant message state data with a URL.


Describe Server Side State Management ?

Answer:

Sever side state managment provied Better security,Reduced bandwidth.

1. Application State: This State information is available to all pages, regardless of which user requests a page.

2. Session State Session State information is available to all pages opened by a user during a single visit.


What is SessionID?

Answer:
To identify the request from the browser used sessionID. SessionId value stored in a cookie. Configure the application to store SessionId in the URL for a \"cookieless\" session.  

What is the Session Identifier?

Answer:

Session Identifier is :

1. To identify session. 

2. It has SessionID property.

3. When a page is requested, browser sends a cookie with a session identifier. 

4. Session identifier is used by the web server to determine if it belongs to an existing session or not. If not, then Session ID is generated by the web server and sent along with the response.  

Advantages of using Session State?

Answer:

Advantages:

1. It is easy to implement.

2. Ensures platform scalability,works in the multi-process configuration.

3. Ensures data durability, since session state retains data even if ASP.NET work process restarts as data in Session State is stored in other process space. 

Disadvantages of using Session State ?

Answer:

Disadvatages:

1. It is not advisable to use session state when working with large sum of data.Because Data in session state is stored in server memory.

2. Too many variables in the memory effect performance. Because session state variable stays in memory until you destroy it.   

What are the Session State Modes? Define each Session State mode supported by ASP.NET.

Answer:

ASP.NET supports three Session State modes.

1. InProc:This mode stores the session data in the ASP.NET worker process and fastest among all of the storage modes.Its Also effects performance if the amount of data to be stored is large.

2. State Server:This mode maintained on a different system and session state is serialized and stored in memory in a separate process.

State Server mode is serialization and de-serialization of objects. State Server mode is slower than InProc mode as this stores data in an external process.

3. SQL Server:This mode can be used in the web farms and reliable and secures storage of a session state.In this storage mode, the Session data is serialized and stored in a database table in the SQL Server database.

  

  

What is a Master Page in Asp.Net?

Answer:
For consistent layout for the pages in application used Master Pages.A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application.Then user create individual content pages that share all the information and lay out of a Master Page.

What are the 2 important parts of a master page and file extension for a Master Page?

Answer:

The following are the 2 important parts of a master page

1. The Master Page itself

2. One or more Content Pages

The file extention for Master Page is \".master\".

How do you identify a Master Page and how do you bind a Content Page to a Master Page?

Answer:

The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.

MasterPageFile attribute of a content page\'s @ Page directive is used to bind a Content Page to a Master Page.

Can you dynaimically assign a Master Page?

Answer:

   void Page_PreInit(Object sender, EventArgs e) {

    

        if (Request.Browser.IsBrowser(\"IE\")) {

           this.MasterPageFile = \"ArticleMaster_IE.master\";

        }

        else if (Request.Browser.IsBrowser(\"Mozilla\")) {

           this.MasterPageFile = \"ArticleMaster_FireFox.master\";

        }

        else {

           this.MasterPageFile = \"ArticleMaster.master\";

        }

    }

From the content page code how can you reference a control on the master page?

Answer:

Use the FindControl() method as shown in the code sample below.

void Page_Load()

{

// Gets a reference to a TextBox control inside

// a ContentPlaceHolder

ContentPlaceHolder ContPlaceHldr = (ContentPlaceHolder)Master.FindControl (\"ContentPlaceHolder1\");

if(ContPlaceHldr != null)

{

TextBox TxtBox = (TextBox)ContPlaceHldr.FindControl(\"TextBox1\");

if(TxtBox != null)

{

TxtBox.Text = \"WHERE R4R\";

}

}

// Gets a reference to a Label control that not in

// a ContentPlaceHolder

Label Lbl = (Label)Master.FindControl(\"Label1\");

if(Lbl != null)

{

Lbl.Text = \"R4R HERE\";

}

}

What is Globalization?

Answer:

Globalization is the process of creating an application that meets the needs of users from multiple cultures.

This process involves translating the user interface elements of an application into multiple languages, using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues. 

What are the 3 different ways to globalize web applications?

Answer:

Detect and redirect approach : In this approach we create a separate Web application for each supported culture, and then detect the users culture and redirect the request to the appropriate application. This approach is best for applications with lots of text content that requires translation and few executable components.

Run-time adjustment approach : In this approach we create a single Web application that detects the users culture and adjusts output at run time using format specifiers and other tools. This approach is best for simple applications that present limited amounts of content.

Satellite assemblies approach : In this approach we create a single Web application that stores culture-dependent strings in resource files that are compiled into satellite assemblies. At run time, detect the users culture and load strings from the appropriate assembly. This approach is best for applications that generate content at run time or that have large executable components.

What are the steps to follow to get user\'s culture at run time?

Answer:

1. Get the Request objects UserLanguages property.

2. Use the returned value with the CultureInfo class to create an object representing the users current culture.


For example, the following code gets the users culture and displays the English name and the abbreviated name of the culture in a label the first time the page is displayed:


private void Page_Load(object sender, System.EventArgs e)

{

// Run the first time the page is displayed

if (!IsPostBack)

{

// Get the user\'s preferred language.

string sLang = Request.UserLanguages[0];

// Create a CultureInfo object from it.

CultureInfo CurrentCulture = new CultureInfo(sLang);

lblCulture.Text = CurrentCulture.EnglishName + \": \" +

CurrentCulture.Name;

}

}

What do you mean by neutral cultures?

Answer:
Neutral cultures represent general languages, such as English or Spanish and a specific language and region.ASP.NET assigns that culture to all the threads running for that Web application.When user set culture attribute for a Web application in Web.config.ASP.NET maintains multiple threads for a Web application within the aspnet_wp.exe worker process. 

What is the advantage of using Windows authentication in a Web application?

Answer:

The advantage of Windows authentication:

1. Web application can use the exact same security that applies to your corporate network like user names, passwords, and permissions.

2. To access the Web application users logged on to the network. It is importent that user does\'nt logged on again.

What is the default authentication method when you create a new Web application project?

Answer:
Windows authentication is the default authentication method when you create a new Web application project.

How do you get a User Identity?

Answer:

Using the User objects Identity property. The Identity property returns an object that includes the user name and role information, as shown in the following code:


private void Page_Load(object sender, System.EventArgs e)

{

Label1.Text = User.Identity.IsAuthenticated.ToString();

Label2.Text = User.Identity.Name;

Label3.Text = User.Identity.AuthenticationType;

}

How do you determine, what is the role of the current user?

Answer:

The User object provides an IsInRole method to determine the role of the current user, as shown in the following example:

if(User.IsInRole(\"Administrators\"))

{

///////

}

Can you specify authorization settings both in Web.config and in IIS?

Answer:
Yes,It wil be done. For this, the IIS setting is evaluated first and then the setting in Web.config is evaluated. Hence we can say,the most restrictive setting will be used.

What are the 2 Layouts supported by a Web form in ASP.NET?

Answer:

1. Grid layout:  Pages using grid layout will not always display correctly in non-Microsoft browsers,and controls are placed exactly where they draw.It means they have absolute positions on the page. Use grid layout for Microsoft Windows style applications, in which controls are not mixed with large amounts of text.

2. Flow layout: Controls relative to other elements on the page.

Controls that appear after the new element move down if you add elements at run time.

Flow layout for document-style applications, in which text and controls are intermingled.

What is the difference between Literal and Lable Control?

Answer:

We use literals control if we want to typed text using HTML formating and without using property.We typed HTML code in .cs file when used literals.

Lable control when displayed already formated.Typed text can not be formated in .cs file.

What is smart navigation?

Answer:

Smart navigation is, cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.


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

Answer:

1. Server.Transfer() performs server side redirection of the page avoiding extra round trip. While The Response. Redirect() method can be used to redirect the browser to specified url.

2. Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site.

Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Answer:

1. A DataSet can represent an entire relational database in memory, complete with tables, relations, and views. 

2. A DataSet is designed to work without any continuing connection to the original data source. 

3. Data in a DataSet is bulk-loaded, rather than being loaded on demand. 

Can you give an example of when you might use it?

Answer:
When you want to inherit (use the functionality of) another class. Base Class Employee. A Manager class could be derived from the Employee base class. 

Can the action attribute of a server-side <form> tag be set to a value and if not how can you possibly pass data from a form page to a subsequent page.

Answer:
No, You have to use Server.Transfer to pass the data to another page.

What is the role of global.asax.

Answer:
Store global information about the application

Whats a bubbled event?

Answer:
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

Describe the difference between inline and code behind.

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

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

Answer:
The .Fill() method 

Can you edit data in the Repeater control?

Answer:
No, it just reads the information from its data source 

Which template must you provide, in order to display data in a Repeater control?

Answer:
ItemTemplate 

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

Answer:
Use the AlternatingItemTemplate 

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

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

Name two properties common in every validation control?

Answer:
ControlToValidate property and Text property

Where does the Web page belong in the .NET Framework class hierarchy?

Answer:
System.Web.UI.Page 

Where do you store the information about the user&#65533;s locale?

Answer:
System.Web.UI.Page.Culture

Can you give an example of what might be best suited to place in the Application Start and Session Start subroutines?

Answer:
This is where you can set the specific variables for the Application and Session objects.

What is the transport protocol you use to call a Web service?

Answer:
 SOAP is the preferred protocol. 

To test a Web service you must create a windows application or Web application to consume this service?

Answer:
The webservice comes with a test page and it provides HTTP-GET method to test.

Whats the difference between struct and class in C#?

Answer:

1. Structs cannot be inherited. 

2. Structs are passed by value, not by reference. 

3. Struct is stored on the stack, not the heap.

Where do the reference-type variables go in the RAM?

Answer:
The references go on the stack, while the objects themselves go on the heap. However, in reality things are more elaborate. 

What is the difference between the value-type variables and reference-type variables in terms of garbage collection?

Answer:
The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null. 

What is main difference between Global.asax and Web.Config?

Answer:
aASP.NET uses the global.asax to establish any global objects that your Web application uses. The .asax extension denotes an application file rather than .aspx for a page file. Each ASP.NET application can contain at most one global.asax file. The file is compiled on the first page hit to your Web application. ASP.NET is also configured so that any attempts to browse to the global.asax page directly are rejected. However, you can specify application-wide settings in the web.config file. The web.config is an XML-formatted text file that resides in the Web sites root directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web site, compilation options for the ASP.NET Web pages, if tracing should be enabled, etc

What is SOAP and how does it relate to XML?

Answer:
The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. Unless experience with SOAP is a direct requirement for the open position, knowing the specifics of the protocol, or how it can be used in conjunction with HTTP, is not as important as identifying it as a natural application of XML. 

Using XSLT, how would you extract a specific attribute from an element in an XML document?

Answer:
Successful candidates should recognize this as one of the most basic applications of XSLT. If they are not able to construct a reply similar to the example below, they should at least be able to identify the components necessary for this operation: xsl:template to match the appropriate XML element, xsl:value-of to select the attribute value, and the optional xsl:apply-templates to continue processing the document.

Whats a Windows process?

Answer:

Its an application thats running and had been allocated memory. 


What is typical about a Windows process in regards to memory allocation?

Answer:

Each process is allocated its own block of available RAM space, no process can access another process code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down. 


Explain what relationship is between a Process, Application Domain, and Application?

Answer:
A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.

Define the possible implementations of distributed applications in .NET?

Answer:

.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services. 


Give your idea when deciding to use .NET Remoting or ASP.NET Web Services?

Answer:

1. Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process.  2. Web Services provide an open-protocol-based exchange of informaion.  Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.


Do you know the proxy of the server object in .NET Remoting?

Answer:

This process is known as marshaling. It handles the communication between real server object and the client object. We can say that It is a fake copy of the server object that resides on the client side and behaves as if it was the server. 

 

What are remotable objects in .NET Remoting?

Answer:

1. They can be marshaled across the application domains.

2. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where  just a reference to an existing object is passed. 

In .NET Remoting, What are channels?

Answer:
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred. 

What security measures exist for .NET Remoting?

Answer:
None. 

What is Singleton activation mode?

Answer:

A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease. 


How to configure a .NET Remoting object via XML file?

Answer:

It can be done via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config. 


How can you automatically generate interface for the remotable object in .NET?

Answer:
Use the Soapsuds tool.

What is the top .NET class that everything is derived from?

Answer:
System.Object. 

Difference between System.String and System.Text.StringBuilder classes?

Answer:

System.String is immutable.  System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed. 


Difference between the System.Array.Clone() and System.Array.CopyTo()?

Answer:
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array.  The CopyTo() method copies the elements into another existing array.  Both perform a shallow copy.  A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array.  A deep copy (which neither of these methods performs) would create a new instance of each element\'s object, resulting in a different, yet identacle object.

What is the .NET collection class that allows an element to be accessed using a unique key?

Answer:
HashTable. 

What class is underneath the SortedList class?

Answer:
A sorted HashTable. 

How to prevent your class from being inherited by another class?

Answer:

We use the sealed keyword to prevent the class from being inherited. 


How to allowed a class to be inherited, but it must be prevent the method from being over-ridden?

Answer:
Just leave the class public and make the method sealed. 

Define abstract class?

Answer:

1. A class that cannot be instantiated.

2. An abstract class is a class that must be inherited and have the methods overridden.

3. An abstract class is essentially a blueprint for a class without any implementation


When you declared a class as abstract?

Answer:

1. When at least one of the methods in the class is abstract.  

2. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.  


Define interface class ?

Answer:
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes. 

How to Specify the accessibility modifier for methods inside the interface?

Answer:

They all must be public, and are therefore public by default. 


What is the difference between an interface and abstract class ?

Answer:

1. In an interface class, all methods are abstract and there is no implementation.  In an abstract class some methods can be concrete.

2. In an interface class, no accessibility modifiers are allowed.  An abstract class may have accessibility modifiers. 

Tell me implicit name of the parameter that gets passed into the set property of a class?

Answer:

The data type of the value parameter is defined by whatever data type the property is declared as. 


What does the keyword virtual declare for a method?

Answer:

The method or property can be overridden.