11 ASP - Net Session16
11 ASP - Net Session16
NET
Objectives
Implicit Localization:
This type of localization enables you to specify that a control
should read the values of its properties from a resource file.
If properties are found in the resource file for the control at the
run time, they are used automatically.
Every ASP.NET page can have a default resource file and
additional resource files for each supported language and
culture.
Resources files are stored in App_LocalResources folder.
For implicit localization to work, automatic culture
determination must be enabled for the page by adding
uiculture=“auto” to the <%@page%> directive.
Explicit Localization:
This type of localization enables you to use an expression to
direct a control to take the value of a specific property from a
specific resource file.
A single set of resource files can be used for many pages in
the application.
Naming convention for resource files in explicit localization is
similar to the naming convention in implicit localization.
However, the names do not have to begin with the file name of
the page.
Resource files are usually placed in App_GlobalResources
directory.
Problem Statement:
You are a developer in the Adventure Works organization, a
fictitious bicycle manufacturer. You have been asked to assist
in the development of the Business-to-Consumer (B2C) Web
application and a related Business-to-Employee (B2E) extranet
portal.
Decisions on the design of the application have already been
made. You have been asked to carry out a number of specific
tasks in order to implement various elements of this design. As
part of the first phase of the B2C development, you have been
asked to add various dynamic features to the Web application.
Solution:
You need to perform following tasks:
1. Add and Configure Controls Dynamically
a. Open the Adventure Works Web site.
b. Add code to determine the number of items in the shopping cart.
c. Add code for creating and configuring Web server controls at run time.
d. Add an event handler method for a Button Object.
e. Add code for creating a control template.
f. Add code to apply the template at run time.