ASP.NET Interview Questions and Answers (1544) - Page 17

What is Reference Equality

To determine whether two variables refer to the same underlying object in memory is called Reference Equality.
ObjectReferenceEquals() is used to make this happen.
What is Value Equality

To determine whether two objects contain the same value or values is called Value Equality.
Performing binary operations with Double type can result,...

NOTE: This is objective type question, Please click question title for correct answer.
What is ?? operator ?

?? is called null-coalescing operator. It is used to define default value of nullable types.
You can use ^ operator to perform logical exclusive-or with,

NOTE: This is objective type question, Please click question title for correct answer.
For gridview, data-binding expressions are resolved at,…

NOTE: This is objective type question, Please click question title for correct answer.
How can you cancel update/cancel of gridview ?

The simplest way to do it is,
e.cancel = true; 

is there any event "ModeChanged"?

Yes.
The event "ModeChanged" is available with DetailsView Control.
It take place whenever DetailsView attempts to change between mode of edit,insert and read-only.
DetailsView also supports "ModeChanging" event.
What is DetailsView?

DetailsView is used when you need to display various fields of a single record in a tabular format.
DetailsView and FormView - Which is better?

Both the controls, DetailsView and FormView are almost similar with the functionalities. Both supports insert, edit and delete for the records. The only difference we can find is the layout they support. DetailsView is composed of DataFields while FormView is composed of templates which leads to tabular format and flow format consequently. Hence, with concern to layout and design, FormView is more flexible to use.
Limitation of boxing nullable type.

If we try to box the object which has no value(which is null) the object reference is assigned to null instead of boxing.
What you should do to avoid SQL Injection?

To avoid or minimize attack of SQL Injection, always use stored procedures or Parameterized query.
What should be done to avoid Script Injection?

To avoid script injection, following things can be done

1. Don't allow user to enter < and > characters as input.
2. Always Encode user's input and then store in the database.
Tell us the different ways to apply CSS in web page?

There are 3 different ways to apply CSS to any page.

1. Create a style sheet file and define all your styles and just provide the reference of the style sheet page in the head section using link tag.

2. Define style in head element of your page and use that styles in your page.

3. Define style inline. Inline style means add style attribute to particular HTML element.
Session state variables are type safe.

NOTE: This is objective type question, Please click question title for correct answer.
Master Pages be nested.

NOTE: This is objective type question, Please click question title for correct answer.
What is the extension for a Master Page file?

The extension of Master Page file is .master.
What are the parts of Master Pages?

Mainly there are two parts of Master Page.

1. The area for Master Page content
2. Area for the child Page, which is replace by child pages content.
What do you mean by ContentPlaceHolder in Master Page?

Master Page works as a parent page for all child pages. There will be some area in master page, which will be used to replace the content of master page with the child page's content. That area is called ContentPlaceHolder.

<asp:ContentPlaceHolder ID="Body" runat="server">

</asp:ContentPlaceHolder>


Over here, content of child page will be displayed.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories