Click here to Skip to main content
15,889,216 members
Articles / Web Development / ASP.NET

ASP.NET Interview Questions for Beginners and Professionals - Part 2

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
7 Apr 2014CPOL4 min read 9.5K   4  
Part 2 in a series of ASP.NET Interview Questions with detailed answers and necessary code examples.

It's Part 2 in a series of ASP.NET Interview Questions with detailed answers and necessary code examples. Part 1 of this series for Interview Questions can be found here.

HTML Server Controls Vs Web Server Controls, Please Define?

HTML Server Controls are server-side mapped form of HTML elements. In order to make HTML elements programmable on server-side, ASP.NET framework added runat="server" attribute, so it's accessible in ASP.NET code-behind. A typical HTML Server Control is as follows:

C#
<input type="text" id="txtFirstName" runat="server" />

On the other hand, Web Server Controls are more feature-rich as compared to HTML server controls and truly designed to provide Win Apps development experience for ASP.NET Web developers. Also, it provides comparatively high level of abstraction. Apart from mapping to existing HTML elements, web server controls provide more rich and complex functionality like Calendar, Grid, Repeater, menu, tree view, etc.

So, Which One Do You Prefer to Use While Developing an ASP.NET Web Application?

Although both of these types of controls render HTML elements but Web Server controls being rich in functionality can render additional HTML tags that collectively fulfill control's functionality. On the other hand, HTML Server Controls are comparatively lightweight only producing the corresponding HTML element.

So, preference depends totally on your circumstances. If you are migrating from a classic ASP application to ASP.NET, then the only choice is using HTML server controls but if you are going to develop a new application and you wanted to provide rich functionality with ease (i.e., calendar, grid, tree view, etc), web server controls are the only choice because we don't have it in HTML server controls.

What is the Role of ValidationSummary Control?

Sometimes, we have a requirement that all validation messages need to display at one location (may be top or bottom of a web form). In such scenario, ValidationSummary control displays all validation messages at one place.
DisplayMode property of this control can be used to display in different formats as follows:

  • BulletList
  • List
  • SingleParagraph

We have already provided few questions about Validation Controls in ASP.NET in the previous article.

Globalization Vs Localization

There are situations when we need to build an application that works for multiple cultures, e.g., en-US, ar-SA, etc. This process of designing and building applications that work for more than one cultures is called globalization. However, customizing an application for a specific culture is localization. Both globalization and localization normally go together.

How to Access Information About a User's Locale in ASP.NET?

User's locale information can be accessed through System.Web.UI.Page.Culture property.

Difference between Culture and UICulture properties in ASP.NET?

CultureInfo class plays an important role for localizing our application pages. Culture is specific in localizing non-visual parts of the page like DateTime, Currency, number formatting, etc. while on the other hand, UICulture is specific in localizing visual part of a webpage like Language being used to display the contents of the web page.

Difference between Local and Global Resources?

Resources for a localized ASP.NET application can be stored locally as well as globally. Local resources are specific to web page and stored in a folder App_LocalResources. It can be accessible to that specific page only. Global resources are accessed by almost all application pages and stored in App_GlobalResources folder.

What is a Neutral Culture? and How is it Different from a Specific Culture?

As we have seen earlier, a culture has two things, i.e., Language and Country/Region. For example, en-Us represents English - United States; en-GB represents English - Great Britain; and ar-SA represents Arabic - Saudi Arabia. So, we can easily understand that first page is language while second is country/region.

A neutral culture is one that is associated only with part 1, i.e., language and not with part 2, i.e., country/region. For example, ar is the neutral name for Arabic culture while ar-SA is specific to Saudi Arabian Arabic culture.

Difference between Response.Write() and Response.Output.Write()?

Difference between Response.Write() and Response.Output.Write() is that the latter provides formatting capability through String.Format-Style which the former doesn't have.

In case of Response.Write(), HttpResponse calls the following method directly:

C#
 public void Write(object obj)
{
    this._writer.Write(obj);
}

The above method internally calls it TextWriter's write() method.

However, in case of Response.Output.Writer(), HttpResponse actually gets reference to TextWriter through Reponse.Output and then after getting control TextWriter, calls other overloaded method that helps to format the string.

C#
Response.Output.Write("This is an {0} test at {1:d}", "amazing", DateTime.Now);

Previous >>> ASP.NET Interview Questions - Part 1

Readers of this Article Might Also Be Interested In

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Emaratech
United Arab Emirates United Arab Emirates
Imran Abdul Ghani has more than 10 years of experience in designing/developing enterprise level applications. He is Microsoft Certified Solution Developer for .NET(MCSD.NET) since 2005. You can reach his blogging at WCF Tutorials, Web Development, SharePoint for Dummies.

Comments and Discussions

 
-- There are no messages in this forum --