ASP.NET 2.0 Interview Preparation Guide
Download PDF

ASP.NET 2.0 Interview Questions and Answers will guide us that ASP.NET 2.0 introduced the concept of master pages, which allow for template based page development. A web application can have one or more master pages, which, beginning with ASP.NET 3.5, can be nested. Master templates have place holder controls, called ContentPlaceHolders to denote where the dynamic content goes, as well as HTML and JavaScript shared across child pages. Learn more with ASP.NET 2.0 Interview Questions with Answers

87 ASP.NET 2.0 Questions and Answers:

Table of Contents:

Operational  ASP.NET 2.0 Job Interview Questions and Answers
Operational ASP.NET 2.0 Job Interview Questions and Answers

1 :: Web service support

a) Data set
b) dataReader
c) both of above
d) none of above

a) Data Set

Web service support Data Set and not support data reader
You can have template column for select and delete instead of the databound column. In which you can mention the destination page where you need to navigate.

Using RowDataBound event, you can add attribute to the select and delete hyperlink like:

e.Row.Cells(CellPosition).Controls(0).Attributes.Add("OnClick","return fnJavascriptFunction()")

e.Row.Cells(CellPosition).Controls(0).Attributes.Add("OnClick","return fnJavascriptFunction('"& If any argument &"')").

3 :: What types of data validation events are commonly seen in the client-side form validation?

Required Field Validator

Requried Filed Validator,Compare filed validator

4 :: Name some ASP Objects?

1. Session Object

2. Application Object

3. Server Object

4. Request Object

5. Response Object

6. Object Context

7. Error Object

5 :: ColumnMapping belongs to which namespaces?

ColumnMapping belongs to which namespaces

system.data.common

6 :: What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?

Server.Transfer is used when redirecting the webpage with in the same applicationwhereasResponse.Redirect is applicabletowards the redirection of webpage between 2 applications

Response.Redirect will instruct browser to call a particular webpage.This will increase one request and one response between the client and server.

7 :: What is PreProcessor in .NET and type, where it use?

The pre-processing directives provide the ability to conditionally skip sections of source files, to report error and warning conditions, and to delineate distinct regions of source code. The term "pre-processing directives" is used only for consistency with the C and C++ programming languages. In C#, there is no separate pre-processing step; pre-processing directives are processed as part of the lexical analysis phase.
A preprocessor directive must be the only instruction on a line. Preprocessing directives are lines in your program that start with `#'. Whitespace is allowed before and after the `#'. The `#' is followed by an identifier that is the directive name. For example, `#define' is the directive
Types are:
#if, #else, #elif, #endif, #define, #undef, #warning, #error, #line, #region, #endregion

They are used for:
Conditional compilation
Line control
Error and Warning reporting

For example u can refere the MS site ...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_2_5_4.asp

8 :: Please brief not about XSD,XSLT & XML?

XSD stands for XML Schema Definition.It define the structure of the XML file and the elements and attributes it contains.The datatype of the elements.So that when u populate XML data into dataset, the dataset can treat elements differently based on their type.If XSD is not present dataset treats all elements as string type. XSLT stands for XML style sheet lang tranformation.It is lang used for transforming XML data in one format to another format.Example XML data into HTML format. XSLT uses XPath to identify the elements in XML doc and transform those to desired format

9 :: List of Words of PreProcessor in .NET?

#if
#else
#elif
#endif
#define
#undef
#warning
#error
#line
#region
#endregion
Main use of directives

10 :: If we remove web.config or machine.config from the application then, Is this application will works?

If we remove the web.config file from the application it will work.

unless it doesnt have the things like connectionstring etc.

11 :: How to reduce the width of textbox in EditCommandColumn of DataGrid?

convert textbox column into a template then it lets you change its width

12 :: Which dll handles the request of .aspx page?

When the Internet Information Service process (inetinfo.exe) receives an HTTP request, it uses the filename extension of the requested resource to determine which Internet Server Application Programming Interface (ISAPI) program to run to process the request. When the request is for an ASP.NET page (.aspx file), IIS passes the request to the ISAPI DLL capable of handling the request for ASP.NET pages, which is aspnet_isapi.dll.

13 :: Explain What is event bubbling?

Event Bubbling is nothing but events raised by child controls is handled by the parent control. Example: Suppose consider datagrid as parent control in which there are several child controls.There can be a column of link buttons right.Each link button has click event.Instead of writing event routine for each link button write one routine for parent which will handlde the click events of the child link button events.Parent can know which child actaully triggered the event.That thru arguments passed to event routine. " Happy programming"

14 :: What is server infrastructure & Server components?

Component product of Windows Server System is effective on its own, as individual components and as part of an integrated system. To provide a framework for Windows Server System product improvement, Starting with the infrastructure server product releases for 2005, with a vision of delivering a common set of services across all Windows Server System products.

All Windows Server System products will provide infrastructure built on the Volume Shadow Copy Service to support fast backup and recovery of data. Each Windows Server System product team will develop a Volume Shadow Copy Service writer. Volume Shadow Copy Service is a framework for facilitating communication among applications, storage subsystems, and storage management applications (including backup applications) to define, persist, and exploit point-in-time copies of storage data.

This infrastructure will provide backup/restore to product solution providers to reduce their cost of product development
and enable IT administrators to provide their organizations with fast backup and recovery of data at reduced costs.

15 :: What is IPostBack? How to use it?

Gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time.
Property Value

true if the page is being loaded in response to a client postback; otherwise, false.

void Page_Load() {
if (!IsPostBack) {
// Validate initially to force asterisks
// to appear before the first roundtrip.
Validate();
}
}

16 :: How to create a DB connection at one place/page so that we can use that connection for all pages/forms/windows.what r the steps ned to be performed.
if question not clear,let me know.

<?xml version="1.0" encoding="utf-8" ?>
<!-- Web.Config Configuration File -->
<configuration>
<appSettings>
<add key="ConnectionString"
value="server=localhost;database=Northwind;uid=sa;password=secret;" />
</appSettings>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration

Public Class ConnString : Inherits Page

Protected dataGrid As DataGrid

Protected Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
Dim sqlConn As SqlConnection
Dim sqlCmd As SqlCommand
Dim strConnection As String

Try
'Get connection string from Web.Config
strConnection = ConfigurationSettings.AppSettings("ConnectionString")
sqlConn = New SqlConnection(strConnection)
sqlCmd = New SqlCommand("SELECT * FROM Customers WHERE " _
& "(CompanyName LIKE 'A%') OR (CompanyName LIKE 'B%')", sqlConn)
sqlConn.Open()
dataGrid.DataSource = sqlCmd.ExecuteReader()
dataGrid.DataBind()
Catch ex As Exception
Response.Write(ex.ToString & "<br>")
Finally
sqlConn.Close()
End Try
End Sub

End Class

17 :: What is diff. between abstract class and an interface?
What is shadowing?
Diff between Overriding and overloading?

An abstract class and Interface both have method only but not have body of method.The difference between Abstract class and An Interface is that if u call Ablstract class then u have to call all method of that particular Abstract class but if u call an Interface then it is not necessary that u call all method of that particular interface.Method OverLoading:-Return type, Parameter type, parameter and body of method number may be different.Method Overriding:- Return type, Parameter type, Parameter Number all must be same . Only body of method can change.

18 :: What is DLL hell?

Previously, before .NET, this used to be a major issue. "DLL Hell" refers to the set of problems caused when multiple applications attempt to share a common component like a dynamic link library (DLL) or a Component Object Model (COM) class. In the most typical case, one application will install a new version of the shared component that is not backward compatible with the version already on the machine. Although the application that has just been installed works well, existing applications that depended on a previous version of the shared component might no longer work. In some cases, the cause of the problem is even more subtle. In many cases there is a significant delay before a user discovers that an application has stopped working. As a result, it is often difficult to remember when a change was made to the machine that could have affected the application. A user may remember installing something a week ago, but there is no obvious correlation between that installation and the behavior they are now seeing. The reason for these issues is that version information about the different components of an application aren't recorded or enforced by the system. Also, changes made to the system on behalf of one application will typically affect all applications on the machine.

19 :: What is CLR? Diff between CLR & CTS?

CLR is the Common Language Runtime for the dotnet frame work.
CTS is the Common Type Sytem for all languages.It consists of the types(Class,Enums,Structs,Interfaces etc for any language)

CTS is one of the component of CLR.

CLR is the Runtime Engine which provide services to execute the application.CTS is part of CLR

20 :: Which namespace is used to get assembly details?

System.Assembly is the namespace which u need to include in u r program to get the assemply details.To get the assemply details of the current running one is thru reflection so u need another namespace calledSystem.Reflection "Happy Programming"

21 :: How does u get record no from 5 to 15 from a dataset of 100 records?

// ds-> daata set

//dr as datarow

for i=5 to 15

{

dr=ds.table.row(i)

}


You can also archive using this syntax. sqlconnection con=new sqlconnection(""); Sqldataadapter da=new Sqldataadapter("T-SQlQUARy",con); dataset ds=new dataset(); da.Fill(ds,5,15,"tablename");

22 :: How do u declare static variable and how it is declared and what is its lifetime?

By using keyword static before the variable name. Static variable retains the same data throughout the execution of a program.

23 :: Explain DIff. between Friend and Protected Friend?

Friend access provides access to member with in the namespaces .The protected friend gives specifies access to the member with in the namespace and the derving classes.

24 :: Lets say I have an existing application written using Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. How would you approach migrating this application to .NET?

COM components are accessed from the .NET runtime via a Runtime Callable Wrapper (RCW). This wrapper turns the COM interfaces exposed by the COM component into .NET-compatible interfaces

25 :: Trace and Debug belongs to which namespaces?

System.Diagnostics
ASP.NET 2.0 Interview Questions and Answers
ASP.NET 2.0 Interview Questions and Answers