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

What are the disadvantages and benefits of view state?

Automatic view-state management is a feature of server controls that enables them to repopulate their property values on a round trip (without you having to write any code). This feature does impact performance, however, since a server control's view state is passed to and from the server in a hidden form field. You should be aware of when view state helps you and when it hinders your page's performance.
differences between Server-side and Client-side code?

Server side code will process at server side & it will send the result to client. Client side code (javascript) will execute only at client side.
What is Role-Based security?

A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager). A principal can be a member of one or more roles. Therefore, applications can use role membership to determine whether a principal is authorized to perform a requested action.
How do you implement postback with a text box?

Make AutoPostBack property to true
What is a master page ?

1) A master page provides a framework in which the content of each page on a web site is presented. Master pages make it easy to create pages that have a consistent look.

2) The pages that provide the content that’s displayed in a master page are called content pages .

3) The content of each content page is displayed in the master page’s content placeholder
Which of the following does not contain Id and Runat Propertys

NOTE: This is objective type question, Please click question title for correct answer.
What is the Default Property of ShowFooter in Gridview

NOTE: This is objective type question, Please click question title for correct answer.
How many types of Validation controls are there in ASP.NET?

There are mainly 5 types of validation controls are there and 1 control is to summarize the validation errors.

They are
? RequiredFieldValidator - to check for mandatory field
? RangeValidator - to check for data in the specified range
? RegularExpressionValidator - to check for data in a particular regular expression
? ComapreValidator - to compare two data or data types
? CustomValidator - to attach a custom a control with the help of user defined function
? ValidationSummary - to summarize all validation error.
Maximum Data that can be stored in a cookie?

NOTE: This is objective type question, Please click question title for correct answer.
What is the best state management variable to save the username for particular session?

NOTE: This is objective type question, Please click question title for correct answer.
What is the Difference Between string and System.Text.StringBuilder?

System.Text.StringBuilder strTest=new System.Text.StringBuilder();
Strings are immutable. immutable means every time we alter the string a new object is created. hence lower the performance. while stringBuilder are mutable. so it increase the performance where we need to perform altered, insert and remove operations. But it is not recommended to use StringBuilder always. for small string where you need to perform less operation then use string
and in case of large string and more operation use StringBuilder.
Which is the Light (Performance wise) Data control from the following?

NOTE: This is objective type question, Please click question title for correct answer.
Should we need to dispose the object after use Explicitly or we need to wait for Garbage Collector to dispose those object?

NOTE: This is objective type question, Please click question title for correct answer.
What is the significance of AutoEventWireUp attribute?

Gets or sets a value indicating whether events for ASP.NET pages are automatically connected to event-handling functions.

@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="TestWebApp.WebForm1"
The AutoEventWireup attribute may have a value of true or false. When an ASP.NET Web Application is created by using Microsoft Visual Studio .NET, the value of the AutoEventWireup attribute is set as false.
We can specify the default value of the AutoEventWireup attribute in the following locations:
• The Machine.config file.
• The Web.config file.
• Individual Web Forms (.aspx files).
• Web User Controls (.ascx files)
The value of the AutoEventWireup attribute can be declared in the <pages> section in the Machine.config file or the Web.config file, as follows
Difference between Localization and Globalization?

Globalization is process of identifying how many resources needs to be localized to adopt a multiple culture support, while Localization is actual process of translating resource to a specific culture. So Localization is the part of Globalization.
Difference between ASP.Net Website and ASP.Net Web Application?

a.)ASP.Net Website (Microsoft Visual Studio’s default type):
i. Local Resource is treated as content based resource, so we can change it and it affects to website.
ii. Global Resource is treated as embedded resource, So they are compiled into specific language dlls into bin folder.
b.ASP.Net Web Application
i.Both Local and Global resource are treated as content based resource, so both are editable.
Any change in any type of resource cause whole resource compilation
disadvantages of hidden fields?

1)Increases the HTML size of the page. 

2)You still cannot store structured data
3)Because you can view page of an HTML page, there is no security
4)There is no way to persist the data

How to disable the page viewstate by

NOTE: This is objective type question, Please click question title for correct answer.
How you will get the current Page Url?

NOTE: This is objective type question, Please click question title for correct answer.
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