SlideShare a Scribd company logo
Developing Web Applications Using ASP.NET
In this session, you will learn to:
Explain dynamic control creation in Microsoft ASP.NET 2.0
Add and configure controls dynamically
Explain how to incorporate globalization and localization
features into Web applications
Add localization features to a Web application
Describe when and how to implement dynamic master pages
Describe dynamic Web configuration scenarios
Apply master pages dynamically
Dynamically configure Web applications
Objectives
Developing Web Applications Using ASP.NET
Appearance of some controls on the Web page depends on
run-time conditions.
Code can be written to add, remove, hide, or show controls
in response to conditions.
Each ASP.NET page has a Controls collection.
Container controls, such as Panel and PlaceHolder, also
have a Controls collection.
Controls can be added to a page or container controls by
using the Controls.Add method.
Location of the controls on a page cannot be specified by
using the Controls.Add method.
The layout of the page at runtime can be controlled by
adding the controls to a Panel or PlaceHolder control
instead of adding them to a page.
Dynamic Control Creation
Developing Web Applications Using ASP.NET
To add a control to a Web forms page programmatically,
you need to:
Create an instance of the control and set its properties:
Label myLabel = new Label();
mylabel.Text = “Simple label”;
Add the control to the page. This is typically done during the
Page’s load stage:
private void Page_Load (object sender,
System.EventArgs e)
{
this.Controls.Add(myLabel);
}
A new control can added to the Controls collection of a
container already on the page as:
Panel1.Controls.Add(myLabel);
Dynamic Control Creation (Contd.)
Developing Web Applications Using ASP.NET
When using Tables and TreeViews, you may require to add
subcontrols at run time.
Dynamic control creation is necessary when the result must
be displayed from a user query.
In addition to adding controls at run time, you can also
remove, hide, or show controls at run time.
Dynamic Control Creation (Contd.)
Developing Web Applications Using ASP.NET
You can create templates dynamically in code.
Dynamically created templates are used when you do not
know until run time which templates to use and what text or
controls to include in them.
You can create templates in code for all controls that use
templates. These controls include:
DataList
Repeater
DataGrid
To create a dynamic template, you need to:
1. Create a template class that implements the ITemplate
interface and defines the InstantiateIn method of the
ITemplate interface.
2. Instantiate the dynamic template
Dynamic Control Creation (Contd.)
Developing Web Applications Using ASP.NET
Web pages can be served automatically in the language
that the user prefers by using ASP.NET.
Preferred language passed by the browser to the server is
used to determine how the page should be localized.
Microsoft .NET Framework applications use resource files
to store data to be displayed for different controls.
For each culture, a different resource file can be created.
An ASP.NET control can be configured to check a resource
file while the page is rendering.
If a control finds a resource file that matches the culture of
the user and if a value is specified for the control in the
resource file:
The value will be substituted for the value of the control on the
page
Localization and Globalization
Developing Web Applications Using ASP.NET
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.
Localization and Globalization (Contd.)
Developing Web Applications Using ASP.NET
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.
Localization and Globalization (Contd.)
Developing Web Applications Using ASP.NET
A master page can be made dynamic just as ordinary
ASP.NET pages.
Code in a content page can alter the properties or controls
specified by the master page.
Public methods and properties on the master page can be
accessed from code in the content page. To do this:
1. Assign a class name to the master page in the <@master>
directive:
<@Master ClassName=“myMasterPage”%>
2. Access the methods and properties in the master page from
the content page:
myMasterPage masterPage=
(myMasterPage)this.Master;
CompanyName.Text = masterPage.CompanyName;
Dynamic Master Pages
Developing Web Applications Using ASP.NET
An object returned by Page.Master must be explicitly type
casted to the type specified for the master page variable.
The type casting requirement can be removed in the by
using the <%@ MasterType%> directive in the content page:
<%@ page masterPageFile=“~/MasterPage.master”%>
<%@ MasterType
virtualPath=“~/MasterPage.master”%>
Dynamic Master Pages (Contd.)
Developing Web Applications Using ASP.NET
Controls on a master page are protected. Therefore, you
cannot refer to them directly from a content page.
To access the methods and properties of a master page
from code in a content page, you can use the
FindControl method:
Label labelOnMasterPage = (Label)
(this.Master.FindControl (“masterPageLabel”));
if(labelOnMasterPage != null)
{
Response.Write(“Master Page label = “ +
labelOnMasterPage.Text);
}
Dynamic Master Pages (Contd.)
Developing Web Applications Using ASP.NET
A content page is usually assigned a master page at design
time by using the <%@ Page masterPageFile=
“xxx”%> directive.
A content page can refer a different master page at run time
by using the Page.MasterPageFile property.
MasterPageFile property is usually set in the
Page_PreInit event handler.
Dynamic Master Pages (Contd.)
Developing Web Applications Using ASP.NET
ASP.NET application can be configured by using:
Machine.config file, the root Web.config file for the server, or
the Web.config files on the Web site
ASP.NET Microsoft Management Console (MMC) snap-in
ASP.NET Web Site Administration tool
In some cases, the preceding tools might not provide the
required combination of configuration capabilities.
ASP.NET Configuration Application Programming Interface
(API) can be used to write the code to configure Web
applications without editing the XML configuration files.
Dynamic Web Configuration
Developing Web Applications Using ASP.NET
Generalized administration tools provide access to all the
properties of a site. Therefore, these tools provide
administrators full control over a site.
You can create a customized administration tool that allows
administrators to access only the configuration settings that
they require.
The interface of the customized administration tool can be
designed according to the preferences and job
responsibilities of the user.
Dynamic Web Configuration (Contd.)
Developing Web Applications Using ASP.NET
To build a configuration tool, you first need to open the
configuration file.
Configuration API is located in System.Configuration
and System.Web.Configuration namespaces.
To access machine.config file, the
OpenMachineConfiguration method can be used.
To access Web.config file OpenWebConfiguration
method can be used, as follows:
Configuration config;
Config = System.Web.Configuration.
WebConfigurationManager.
OpenWebConfiguration(“~”);
Dynamic Web Configuration (Contd.)
Developing Web Applications Using ASP.NET
After a configuration file has been opened, you can perform
the following operations on the file:
Query the various sections of the file and change their properties
Modify configuration values
Use Save method to write changes back to the configuration
file
The following example shows how to enable the debug
feature by manipulating a configuration file:
System.Web.Configuration.CompilationSection
compilation;
compilation =
config.GetSection(“system.web/compilation”)as
System.Web.Configuration.CompilationSection;
comilation.Debug = true;
compilation.Save();
Dynamic Web Configuration (Contd.)
Developing Web Applications Using ASP.NET
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.
Demo: Building Dynamic Web Applications
Developing Web Applications Using ASP.NET
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.
Demo: Building Dynamic Web Applications (Contd.)
Developing Web Applications Using ASP.NET
2. Apply Master Pages Dynamically
a. Determine run-time conditions in the Page_PreInit method.
b. Apply a different master page if the shopping cart is empty.
c. Test the Web application.
3. Add Localization Features
a. Add a Welcome label to the TopLevel.master page.
b. Generate resource for the TopLevel.master page.
c. Set the UICulture for the Default.aspx page.
d. Configure the languages for the Internet Explorer and test the Web
application.
4. Configure Web Application Dynamically
a. Retrieve configuration settings at run time.
b. Modify configuration settings at run time.
c. Configure and test the Web application.
Demo: Building Dynamic Web Applications (Contd.)
Developing Web Applications Using ASP.NET
In this session, you learned that:
Appearance of some controls on the Web page depends on
run-time conditions.
Code can be written to add, remove, hide, or show controls in
response to conditions.
Resource files used by Microsoft .Net applications are useful
for handling cultural differences.
In implicit localization, specification can be given to a control to
read the values of its properties from a resource file.
In explicit localization, an expression can be used to direct a
control to take the value of a specific property from a specific
resource file.
Public methods and properties on the master page can be
called from code in the content page.
Summary
Developing Web Applications Using ASP.NET
Controls on the master page cannot be referred directly from
the content page. The FindControl method must be used for
this reference.
The Page.MasterPageFile property can be used by
content page to refer a master page at run time.
The ASP.NET Configuration API can be used to write code to
configure the Web application without editing the XML
configuration file.
Summary (Contd.)

More Related Content

What's hot

Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
Luis Valencia
 
Templates, partials and layouts
Templates, partials and layoutsTemplates, partials and layouts
Templates, partials and layouts
Kadiv Vech
 
Creating web form
Creating web formCreating web form
Creating web form
mentorrbuddy
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
Reshi Unen
 
Asp.net By Durgesh Singh
Asp.net By Durgesh SinghAsp.net By Durgesh Singh
Asp.net By Durgesh Singh
imdurgesh
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csVaibhav Chavan
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauSpiffy
 
How to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdfHow to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdf
gerardov5
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
SPTechCon
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...
Appear
 
Taking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and BeyondTaking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and Beyond
Salesforce Developers
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
Ankit Gupta
 
Rails
RailsRails
RailsSHC
 
Offline Storage
Offline StorageOffline Storage
Offline Storage
SP Balamurugan
 

What's hot (20)

Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 
Templates, partials and layouts
Templates, partials and layoutsTemplates, partials and layouts
Templates, partials and layouts
 
Creating web form
Creating web formCreating web form
Creating web form
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
 
Asp.net By Durgesh Singh
Asp.net By Durgesh SinghAsp.net By Durgesh Singh
Asp.net By Durgesh Singh
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_cs
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
How to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdfHow to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdf
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...
 
Taking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and BeyondTaking Apex and Visualforce Above and Beyond
Taking Apex and Visualforce Above and Beyond
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
 
Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
 
Rails
RailsRails
Rails
 
Offline Storage
Offline StorageOffline Storage
Offline Storage
 
DEVICE CHANNELS
DEVICE CHANNELSDEVICE CHANNELS
DEVICE CHANNELS
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 

Viewers also liked

09 asp.net session13
09 asp.net session1309 asp.net session13
09 asp.net session13
Vivek chan
 
01 intel v_tune_session_01
01 intel v_tune_session_0101 intel v_tune_session_01
01 intel v_tune_session_01
Vivek chan
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
Vivek chan
 
CyberLab Work-EX Program
CyberLab Work-EX ProgramCyberLab Work-EX Program
CyberLab Work-EX Program
Vivek chan
 
CyberLab Training Division
CyberLab Training DivisionCyberLab Training Division
CyberLab Training Division
Vivek chan
 
10 asp.net session14
10 asp.net session1410 asp.net session14
10 asp.net session14
Vivek chan
 
CyberLab Development Division
CyberLab Development Division CyberLab Development Division
CyberLab Development Division
Vivek chan
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05
Vivek chan
 
07 asp.net session10
07 asp.net session1007 asp.net session10
07 asp.net session10
Vivek chan
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
Vivek chan
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
Vivek chan
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
Vivek chan
 
CyberLab Vehicle Tracking System
CyberLab Vehicle Tracking SystemCyberLab Vehicle Tracking System
CyberLab Vehicle Tracking System
Vivek chan
 
03 intel v_tune_session_04
03 intel v_tune_session_0403 intel v_tune_session_04
03 intel v_tune_session_04
Vivek chan
 
What is Robotics - Robotics Concept Explained for Kids
What is Robotics - Robotics Concept Explained for KidsWhat is Robotics - Robotics Concept Explained for Kids
What is Robotics - Robotics Concept Explained for Kids
Vivek chan
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking drivers
Vivek chan
 
Complete Osi Model Explained
Complete Osi Model ExplainedComplete Osi Model Explained
Complete Osi Model Explained
Vivek chan
 

Viewers also liked (17)

09 asp.net session13
09 asp.net session1309 asp.net session13
09 asp.net session13
 
01 intel v_tune_session_01
01 intel v_tune_session_0101 intel v_tune_session_01
01 intel v_tune_session_01
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
 
CyberLab Work-EX Program
CyberLab Work-EX ProgramCyberLab Work-EX Program
CyberLab Work-EX Program
 
CyberLab Training Division
CyberLab Training DivisionCyberLab Training Division
CyberLab Training Division
 
10 asp.net session14
10 asp.net session1410 asp.net session14
10 asp.net session14
 
CyberLab Development Division
CyberLab Development Division CyberLab Development Division
CyberLab Development Division
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05
 
07 asp.net session10
07 asp.net session1007 asp.net session10
07 asp.net session10
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
 
CyberLab Vehicle Tracking System
CyberLab Vehicle Tracking SystemCyberLab Vehicle Tracking System
CyberLab Vehicle Tracking System
 
03 intel v_tune_session_04
03 intel v_tune_session_0403 intel v_tune_session_04
03 intel v_tune_session_04
 
What is Robotics - Robotics Concept Explained for Kids
What is Robotics - Robotics Concept Explained for KidsWhat is Robotics - Robotics Concept Explained for Kids
What is Robotics - Robotics Concept Explained for Kids
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking drivers
 
Complete Osi Model Explained
Complete Osi Model ExplainedComplete Osi Model Explained
Complete Osi Model Explained
 

Similar to 11 asp.net session16

11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16Niit Care
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentationsasidhar
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
Vivek chan
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
Vivek chan
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
Vivek chan
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
Akhil Mittal
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
Vivek chan
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20
Vivek chan
 
Asp.net
Asp.netAsp.net
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architectureIblesoft
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05Niit Care
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
Vivek chan
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
parallelminder
 
Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application Madhuri Kavade
 
Parallelminds.web partdemo1
Parallelminds.web partdemo1Parallelminds.web partdemo1
Parallelminds.web partdemo1
parallelminder
 

Similar to 11 asp.net session16 (20)

11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20
 
Asp.net
Asp.netAsp.net
Asp.net
 
Asp.net architecture
Asp.net architectureAsp.net architecture
Asp.net architecture
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Ch 04 asp.net application
Ch 04 asp.net application Ch 04 asp.net application
Ch 04 asp.net application
 
Parallelminds.web partdemo1
Parallelminds.web partdemo1Parallelminds.web partdemo1
Parallelminds.web partdemo1
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 

More from Vivek chan

Deceptive Marketing.pdf
Deceptive Marketing.pdfDeceptive Marketing.pdf
Deceptive Marketing.pdf
Vivek chan
 
brain controled wheel chair.pdf
brain controled wheel chair.pdfbrain controled wheel chair.pdf
brain controled wheel chair.pdf
Vivek chan
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Vivek chan
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Vivek chan
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using Thoughts
Vivek chan
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant
Vivek chan
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant
Vivek chan
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Vivek chan
 
Net framework session01
Net framework session01Net framework session01
Net framework session01
Vivek chan
 
Net framework session02
Net framework session02Net framework session02
Net framework session02
Vivek chan
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
Vivek chan
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
Vivek chan
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10
Vivek chan
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22
Vivek chan
 
08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
Vivek chan
 

More from Vivek chan (15)

Deceptive Marketing.pdf
Deceptive Marketing.pdfDeceptive Marketing.pdf
Deceptive Marketing.pdf
 
brain controled wheel chair.pdf
brain controled wheel chair.pdfbrain controled wheel chair.pdf
brain controled wheel chair.pdf
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using Thoughts
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant
 
Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant Vivek Chan | Technology Consultant
Vivek Chan | Technology Consultant
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
 
Net framework session01
Net framework session01Net framework session01
Net framework session01
 
Net framework session02
Net framework session02Net framework session02
Net framework session02
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22
 
08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
 

Recently uploaded

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 

Recently uploaded (20)

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 

11 asp.net session16

  • 1. Developing Web Applications Using ASP.NET In this session, you will learn to: Explain dynamic control creation in Microsoft ASP.NET 2.0 Add and configure controls dynamically Explain how to incorporate globalization and localization features into Web applications Add localization features to a Web application Describe when and how to implement dynamic master pages Describe dynamic Web configuration scenarios Apply master pages dynamically Dynamically configure Web applications Objectives
  • 2. Developing Web Applications Using ASP.NET Appearance of some controls on the Web page depends on run-time conditions. Code can be written to add, remove, hide, or show controls in response to conditions. Each ASP.NET page has a Controls collection. Container controls, such as Panel and PlaceHolder, also have a Controls collection. Controls can be added to a page or container controls by using the Controls.Add method. Location of the controls on a page cannot be specified by using the Controls.Add method. The layout of the page at runtime can be controlled by adding the controls to a Panel or PlaceHolder control instead of adding them to a page. Dynamic Control Creation
  • 3. Developing Web Applications Using ASP.NET To add a control to a Web forms page programmatically, you need to: Create an instance of the control and set its properties: Label myLabel = new Label(); mylabel.Text = “Simple label”; Add the control to the page. This is typically done during the Page’s load stage: private void Page_Load (object sender, System.EventArgs e) { this.Controls.Add(myLabel); } A new control can added to the Controls collection of a container already on the page as: Panel1.Controls.Add(myLabel); Dynamic Control Creation (Contd.)
  • 4. Developing Web Applications Using ASP.NET When using Tables and TreeViews, you may require to add subcontrols at run time. Dynamic control creation is necessary when the result must be displayed from a user query. In addition to adding controls at run time, you can also remove, hide, or show controls at run time. Dynamic Control Creation (Contd.)
  • 5. Developing Web Applications Using ASP.NET You can create templates dynamically in code. Dynamically created templates are used when you do not know until run time which templates to use and what text or controls to include in them. You can create templates in code for all controls that use templates. These controls include: DataList Repeater DataGrid To create a dynamic template, you need to: 1. Create a template class that implements the ITemplate interface and defines the InstantiateIn method of the ITemplate interface. 2. Instantiate the dynamic template Dynamic Control Creation (Contd.)
  • 6. Developing Web Applications Using ASP.NET Web pages can be served automatically in the language that the user prefers by using ASP.NET. Preferred language passed by the browser to the server is used to determine how the page should be localized. Microsoft .NET Framework applications use resource files to store data to be displayed for different controls. For each culture, a different resource file can be created. An ASP.NET control can be configured to check a resource file while the page is rendering. If a control finds a resource file that matches the culture of the user and if a value is specified for the control in the resource file: The value will be substituted for the value of the control on the page Localization and Globalization
  • 7. Developing Web Applications Using ASP.NET 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. Localization and Globalization (Contd.)
  • 8. Developing Web Applications Using ASP.NET 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. Localization and Globalization (Contd.)
  • 9. Developing Web Applications Using ASP.NET A master page can be made dynamic just as ordinary ASP.NET pages. Code in a content page can alter the properties or controls specified by the master page. Public methods and properties on the master page can be accessed from code in the content page. To do this: 1. Assign a class name to the master page in the <@master> directive: <@Master ClassName=“myMasterPage”%> 2. Access the methods and properties in the master page from the content page: myMasterPage masterPage= (myMasterPage)this.Master; CompanyName.Text = masterPage.CompanyName; Dynamic Master Pages
  • 10. Developing Web Applications Using ASP.NET An object returned by Page.Master must be explicitly type casted to the type specified for the master page variable. The type casting requirement can be removed in the by using the <%@ MasterType%> directive in the content page: <%@ page masterPageFile=“~/MasterPage.master”%> <%@ MasterType virtualPath=“~/MasterPage.master”%> Dynamic Master Pages (Contd.)
  • 11. Developing Web Applications Using ASP.NET Controls on a master page are protected. Therefore, you cannot refer to them directly from a content page. To access the methods and properties of a master page from code in a content page, you can use the FindControl method: Label labelOnMasterPage = (Label) (this.Master.FindControl (“masterPageLabel”)); if(labelOnMasterPage != null) { Response.Write(“Master Page label = “ + labelOnMasterPage.Text); } Dynamic Master Pages (Contd.)
  • 12. Developing Web Applications Using ASP.NET A content page is usually assigned a master page at design time by using the <%@ Page masterPageFile= “xxx”%> directive. A content page can refer a different master page at run time by using the Page.MasterPageFile property. MasterPageFile property is usually set in the Page_PreInit event handler. Dynamic Master Pages (Contd.)
  • 13. Developing Web Applications Using ASP.NET ASP.NET application can be configured by using: Machine.config file, the root Web.config file for the server, or the Web.config files on the Web site ASP.NET Microsoft Management Console (MMC) snap-in ASP.NET Web Site Administration tool In some cases, the preceding tools might not provide the required combination of configuration capabilities. ASP.NET Configuration Application Programming Interface (API) can be used to write the code to configure Web applications without editing the XML configuration files. Dynamic Web Configuration
  • 14. Developing Web Applications Using ASP.NET Generalized administration tools provide access to all the properties of a site. Therefore, these tools provide administrators full control over a site. You can create a customized administration tool that allows administrators to access only the configuration settings that they require. The interface of the customized administration tool can be designed according to the preferences and job responsibilities of the user. Dynamic Web Configuration (Contd.)
  • 15. Developing Web Applications Using ASP.NET To build a configuration tool, you first need to open the configuration file. Configuration API is located in System.Configuration and System.Web.Configuration namespaces. To access machine.config file, the OpenMachineConfiguration method can be used. To access Web.config file OpenWebConfiguration method can be used, as follows: Configuration config; Config = System.Web.Configuration. WebConfigurationManager. OpenWebConfiguration(“~”); Dynamic Web Configuration (Contd.)
  • 16. Developing Web Applications Using ASP.NET After a configuration file has been opened, you can perform the following operations on the file: Query the various sections of the file and change their properties Modify configuration values Use Save method to write changes back to the configuration file The following example shows how to enable the debug feature by manipulating a configuration file: System.Web.Configuration.CompilationSection compilation; compilation = config.GetSection(“system.web/compilation”)as System.Web.Configuration.CompilationSection; comilation.Debug = true; compilation.Save(); Dynamic Web Configuration (Contd.)
  • 17. Developing Web Applications Using ASP.NET 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. Demo: Building Dynamic Web Applications
  • 18. Developing Web Applications Using ASP.NET 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. Demo: Building Dynamic Web Applications (Contd.)
  • 19. Developing Web Applications Using ASP.NET 2. Apply Master Pages Dynamically a. Determine run-time conditions in the Page_PreInit method. b. Apply a different master page if the shopping cart is empty. c. Test the Web application. 3. Add Localization Features a. Add a Welcome label to the TopLevel.master page. b. Generate resource for the TopLevel.master page. c. Set the UICulture for the Default.aspx page. d. Configure the languages for the Internet Explorer and test the Web application. 4. Configure Web Application Dynamically a. Retrieve configuration settings at run time. b. Modify configuration settings at run time. c. Configure and test the Web application. Demo: Building Dynamic Web Applications (Contd.)
  • 20. Developing Web Applications Using ASP.NET In this session, you learned that: Appearance of some controls on the Web page depends on run-time conditions. Code can be written to add, remove, hide, or show controls in response to conditions. Resource files used by Microsoft .Net applications are useful for handling cultural differences. In implicit localization, specification can be given to a control to read the values of its properties from a resource file. In explicit localization, an expression can be used to direct a control to take the value of a specific property from a specific resource file. Public methods and properties on the master page can be called from code in the content page. Summary
  • 21. Developing Web Applications Using ASP.NET Controls on the master page cannot be referred directly from the content page. The FindControl method must be used for this reference. The Page.MasterPageFile property can be used by content page to refer a master page at run time. The ASP.NET Configuration API can be used to write code to configure the Web application without editing the XML configuration file. Summary (Contd.)