Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
4Activity
0 of .
Results for:
No results containing your search query
P. 1
11 ASP.net Session16

11 ASP.net Session16

Ratings: (0)|Views: 100 |Likes:
Published by vijaysharma24x7

More info:

Published by: vijaysharma24x7 on Oct 15, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPS, PDF, TXT or read online from Scribd
See more
See less

09/16/2010

pdf

text

original

 
Slide 1 of 21
Ver. 1.0
Developing Web Applications Using ASP.NET
In this session, you will learn to:
Explain dynamic control creation in Microsoft ASP.NET 2.0Add and configure controls dynamicallyExplain how to incorporate globalization and localizationfeatures into Web applicationsAdd localization features to a Web applicationDescribe when and how to implement dynamic master pagesDescribe dynamic Web configuration scenariosApply master pages dynamicallyDynamically configure Web applications
Objectives
 
Slide 2 of 21
Ver. 1.0
Developing Web Applications Using ASP.NET
Appearance of some controls on the Web page depends onrun-time conditions.Code can be written to add, remove, hide, or show controlsin response to conditions.Each ASP.NET page has a
Controls
collection.Container controls, such as
Panel
and
PlaceHolder
, alsohave a
Controls
collection.Controls can be added to a page or container controls byusing the
Controls.Add
method.Location of the controls on a page cannot be specified byusing the
Controls.Add
method.The layout of the page at runtime can be controlled byadding the controls to a
Panel
or 
PlaceHolder
controlinstead of adding them to a page.
Dynamic Control Creation
 
Slide 3 of 21
Ver. 1.0
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 thePage
’ 
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 acontainer already on the page as:
Panel1.Controls.Add(myLabel);
Dynamic Control Creation (Contd.)

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->