Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

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

, 7 Apr 2014
Rate this:
Please Sign up or sign in to vote.
It's Part-2 in 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 or

It's Part-2 in 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:

<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 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 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 previous article.

Globalization Vs Localization

There are situations when we need to build an application that work 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 its different from a Specific Culture?

As we have seen earlier that 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 later provide formatting capability through String.Format-Style which the former doesn't have.

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

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

Above method internally calls it TextWriter's write() method.

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

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

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

Reader 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)

Share

About the Author

Imran Abdul Ghani
Software Developer (Senior)
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.
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web01 | 2.8.140905.1 | Last Updated 7 Apr 2014
Article Copyright 2014 by Imran Abdul Ghani
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid