SlideShare uma empresa Scribd logo
1 de 15
• What are rich controls
• The Calendar Control
• The AdRotator
• The MultiView Control
• The Wizard Control
Rich controls are web controls that model
complex user interface elements and give
you a way to create advanced user interfaces
in your web pages without writing lines of
convoluted HTML
The Calendar control presents a miniature calendar that
you can place in any web page. Like most rich controls,
the Calendar can be programmed as a single object (and
defined in a single simple tag), but it renders itself with
dozens of lines of HTML output.

<asp:Calendar id="MyCalendar" runat="server" />
You can set various parts of the calendar, like the header, selector,
and various day types, by using one of the style properties
In most situations where you need to use a calendar for
selection, you don’t want to allow the user to select any
date in the calendar.

The basic approach to restricting dates is to write an event
handler for the Calendar.DayRender event.

protected void MyCalendar_DayRender(Object source, DayRenderEventArgs e)
{
// Restrict dates after the year 2012 and those on the weekend.

if (e.Day.IsWeekend || e.Day.Date.Year > 2012)
{
e.Day.IsSelectable = false;
}

}
The e.Day object is an instance of the CalendarDay class,
which provides various properties.
The basic purpose of the AdRotator is to provide a
graphic on a page that is chosen randomly from a group
of possible images. In other words, every time the page is
requested, an image is selected at random and displayed,
which is the “rotation” indicated by the name AdRotator.

<Advertisements>
<Ad>
<ImageUrl>prosetech.jpg</ImageUrl>
<NavigateUrl>http://www.prosetech.com</NavigateUrl>
<AlternateText>ProseTech Site</AlternateText>
<Impressions>1</Impressions>
<Keyword>Computer</Keyword>
</Ad>
</Advertisements>
You can set the KeywordFilter property so that the banner
  will be chosen from a specific keyword group.
<asp:AdRotator id="Ads" runat="server" AdvertisementFile="MainAds.xml"
Target="_blank" KeywordFilter="Computer“

 You can react to the AdRotator.AdCreated event. This
 occurs when the page is being created and an image is
 randomly chosen from the advertisements file
  protected void Ads_AdCreated(Object sender, AdCreatedEventArgs e)
  {
  // Synchronize the Hyperlink control.
  lnkBanner.NavigateUrl = e.NavigateUrl;
  // Syncrhonize the text of the link.
  lnkBanner.Text = "Click here for information about our sponsor: ";
  lnkBanner.Text += e.AlternateText;
  }
The MultiView gives you a way to declare multiple
views and show only one at a time. It has no default
user interface—you get only whatever HTML and
controls you add

Creating a MultiView is suitably straightforward. You add the
<asp:MultiView> tag to your .aspx page file and then add one
<asp:View> tag inside it for each separate view:

<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">...</asp:View>
<asp:View ID="View2" runat="server">...</asp:View>
<asp:View ID="View3" runat="server">...</asp:View>
</asp:MultiView>
MultiView1.ActiveViewIndex = 0;
        Or
        MultiView1.SetActiveView(View1);

The MultiView includes some built-in smarts that can save you a lot
of trouble. Here’s how it works: the MultiView recognizes button
controls with specific command names.

<asp:Button ID="Button1" runat="server" CommandArgument="View2"
CommandName="SwitchViewByID" Text="Go to View2" />

<asp:Button ID="Button1" runat="server" Text=“Prev“
CommandName="PrevView" />

<asp:Button ID="Button2" runat="server" Text="Next"
CommandName="NextView" />
Wizards represent a single task, and the user moves
linearly through them, moving from the current step to the
one immediately following it (or the one immediately
preceding it in the case of a correction). The ASP.NET
Wizard control also supports nonlinear navigation, which
means it allows you to decide to ignore a step based on
the information the user supplies.
You can add as many WizardStep controls inside the
Wizard as you want. Conceptually, the WizardStep plays
the same role as the View in a MultiView. You place the
content for each step inside the WizardStep control.

 <asp:Wizard ID="Wizard1" runat="server" ... >
 <WizardSteps>
 <asp:WizardStep runat="server" Title="Step 1">
 ...
 </asp:WizardStep>
 <asp:WizardStep runat="server" Title="Step 2">
 ...
 </asp:WizardStep>
 ...
 <WizardSteps>
 </asp:Wizard>
Chapter 10
Chapter 10
Chapter 10

Mais conteúdo relacionado

Mais procurados

multiple views and routing
multiple views and routingmultiple views and routing
multiple views and routing
Brajesh Yadav
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_librariesSpca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_libraries
NCCOMMS
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts New
LiquidHub
 

Mais procurados (19)

AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
How routing works in angular js
How routing works in angular jsHow routing works in angular js
How routing works in angular js
 
multiple views and routing
multiple views and routingmultiple views and routing
multiple views and routing
 
Directives
DirectivesDirectives
Directives
 
jQuery and AJAX with Rails
jQuery and AJAX with RailsjQuery and AJAX with Rails
jQuery and AJAX with Rails
 
AngularJS & Drupal - Андрей Березовский
AngularJS & Drupal - Андрей БерезовскийAngularJS & Drupal - Андрей Березовский
AngularJS & Drupal - Андрей Березовский
 
Shaping up with angular JS
Shaping up with angular JSShaping up with angular JS
Shaping up with angular JS
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android Programming
 
Spca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_librariesSpca2014 hillier 3rd party_javascript_libraries
Spca2014 hillier 3rd party_javascript_libraries
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular js
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts New
 
Angular introduction basic
Angular introduction basicAngular introduction basic
Angular introduction basic
 
Single page application 03
Single page application   03Single page application   03
Single page application 03
 
Training in Asp.net mvc3 platform-apextgi,noidaAspnetmvc3 j query
Training in Asp.net mvc3 platform-apextgi,noidaAspnetmvc3 j queryTraining in Asp.net mvc3 platform-apextgi,noidaAspnetmvc3 j query
Training in Asp.net mvc3 platform-apextgi,noidaAspnetmvc3 j query
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Phonegap cordova selecting multiple photos
Phonegap cordova selecting multiple photosPhonegap cordova selecting multiple photos
Phonegap cordova selecting multiple photos
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 

Destaque

RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
Bhumivaghasiya
 
AdRotator and AdRepeater Control in Asp.Net for Msc CS
AdRotator and AdRepeater Control in Asp.Net for Msc CSAdRotator and AdRepeater Control in Asp.Net for Msc CS
AdRotator and AdRepeater Control in Asp.Net for Msc CS
Thanveen
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
Raed Aldahdooh
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
thinkphp
 

Destaque (17)

Controls
ControlsControls
Controls
 
Adepus news no. 1
Adepus news no. 1Adepus news no. 1
Adepus news no. 1
 
Synapse india reviews sharing chapter 23 – asp.net-part2
Synapse india reviews sharing  chapter 23 – asp.net-part2Synapse india reviews sharing  chapter 23 – asp.net-part2
Synapse india reviews sharing chapter 23 – asp.net-part2
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
Asp.net event handler
Asp.net event handlerAsp.net event handler
Asp.net event handler
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 
Introduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET ControlsIntroduction of VS2012 IDE and ASP.NET Controls
Introduction of VS2012 IDE and ASP.NET Controls
 
AdRotator and AdRepeater Control in Asp.Net for Msc CS
AdRotator and AdRepeater Control in Asp.Net for Msc CSAdRotator and AdRepeater Control in Asp.Net for Msc CS
AdRotator and AdRepeater Control in Asp.Net for Msc CS
 
PHP 5 Magic Methods
PHP 5 Magic MethodsPHP 5 Magic Methods
PHP 5 Magic Methods
 
Jquery Ajax
Jquery AjaxJquery Ajax
Jquery Ajax
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
 
Oops in PHP
Oops in PHPOops in PHP
Oops in PHP
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 

Semelhante a Chapter 10

Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kit
Vidhi Patel
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
Anton Narusberg
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
OSCON Byrum
 
Displaying additional image types in XMetaL
Displaying additional image types in XMetaLDisplaying additional image types in XMetaL
Displaying additional image types in XMetaL
XMetaL
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
Spike Brehm
 

Semelhante a Chapter 10 (20)

Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 
Lightning Components Workshop v2
Lightning Components Workshop v2Lightning Components Workshop v2
Lightning Components Workshop v2
 
Ajax control tool kit
Ajax control tool kitAjax control tool kit
Ajax control tool kit
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 
Salesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopSalesforce Lightning Components Workshop
Salesforce Lightning Components Workshop
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components Workshop
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components Workshop
 
ASP.NET 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server ControlsASP.NET 04 - Additional Web Server Controls
ASP.NET 04 - Additional Web Server Controls
 
Introduction to React and MobX
Introduction to React and MobXIntroduction to React and MobX
Introduction to React and MobX
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg...
 Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg... Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg...
Little Opinions, Big Possibilities: The Tools and Patterns for Building Larg...
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle StudiosAngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
AngularJs Superheroic JavaScript MVW Framework Services by Miracle Studios
 
A comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentA comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter component
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Displaying additional image types in XMetaL
Displaying additional image types in XMetaLDisplaying additional image types in XMetaL
Displaying additional image types in XMetaL
 
Aurelia Meetup Paris
Aurelia Meetup ParisAurelia Meetup Paris
Aurelia Meetup Paris
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 

Mais de application developer (20)

Chapter 26
Chapter 26Chapter 26
Chapter 26
 
Chapter 25
Chapter 25Chapter 25
Chapter 25
 
Chapter 23
Chapter 23Chapter 23
Chapter 23
 
Assignment
AssignmentAssignment
Assignment
 
Next step job board (Assignment)
Next step job board (Assignment)Next step job board (Assignment)
Next step job board (Assignment)
 
Chapter 19
Chapter 19Chapter 19
Chapter 19
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 
Chapter 17
Chapter 17Chapter 17
Chapter 17
 
Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Week 3 assignment
Week 3 assignmentWeek 3 assignment
Week 3 assignment
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
C # test paper
C # test paperC # test paper
C # test paper
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Chapter 8 part2
Chapter 8   part2Chapter 8   part2
Chapter 8 part2
 
Chapter 8 part1
Chapter 8   part1Chapter 8   part1
Chapter 8 part1
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Chapter 10

  • 1. • What are rich controls • The Calendar Control • The AdRotator • The MultiView Control • The Wizard Control
  • 2. Rich controls are web controls that model complex user interface elements and give you a way to create advanced user interfaces in your web pages without writing lines of convoluted HTML
  • 3. The Calendar control presents a miniature calendar that you can place in any web page. Like most rich controls, the Calendar can be programmed as a single object (and defined in a single simple tag), but it renders itself with dozens of lines of HTML output. <asp:Calendar id="MyCalendar" runat="server" />
  • 4. You can set various parts of the calendar, like the header, selector, and various day types, by using one of the style properties
  • 5. In most situations where you need to use a calendar for selection, you don’t want to allow the user to select any date in the calendar. The basic approach to restricting dates is to write an event handler for the Calendar.DayRender event. protected void MyCalendar_DayRender(Object source, DayRenderEventArgs e) { // Restrict dates after the year 2012 and those on the weekend. if (e.Day.IsWeekend || e.Day.Date.Year > 2012) { e.Day.IsSelectable = false; } }
  • 6. The e.Day object is an instance of the CalendarDay class, which provides various properties.
  • 7. The basic purpose of the AdRotator is to provide a graphic on a page that is chosen randomly from a group of possible images. In other words, every time the page is requested, an image is selected at random and displayed, which is the “rotation” indicated by the name AdRotator. <Advertisements> <Ad> <ImageUrl>prosetech.jpg</ImageUrl> <NavigateUrl>http://www.prosetech.com</NavigateUrl> <AlternateText>ProseTech Site</AlternateText> <Impressions>1</Impressions> <Keyword>Computer</Keyword> </Ad> </Advertisements>
  • 8. You can set the KeywordFilter property so that the banner will be chosen from a specific keyword group. <asp:AdRotator id="Ads" runat="server" AdvertisementFile="MainAds.xml" Target="_blank" KeywordFilter="Computer“ You can react to the AdRotator.AdCreated event. This occurs when the page is being created and an image is randomly chosen from the advertisements file protected void Ads_AdCreated(Object sender, AdCreatedEventArgs e) { // Synchronize the Hyperlink control. lnkBanner.NavigateUrl = e.NavigateUrl; // Syncrhonize the text of the link. lnkBanner.Text = "Click here for information about our sponsor: "; lnkBanner.Text += e.AlternateText; }
  • 9. The MultiView gives you a way to declare multiple views and show only one at a time. It has no default user interface—you get only whatever HTML and controls you add Creating a MultiView is suitably straightforward. You add the <asp:MultiView> tag to your .aspx page file and then add one <asp:View> tag inside it for each separate view: <asp:MultiView ID="MultiView1" runat="server"> <asp:View ID="View1" runat="server">...</asp:View> <asp:View ID="View2" runat="server">...</asp:View> <asp:View ID="View3" runat="server">...</asp:View> </asp:MultiView>
  • 10. MultiView1.ActiveViewIndex = 0; Or MultiView1.SetActiveView(View1); The MultiView includes some built-in smarts that can save you a lot of trouble. Here’s how it works: the MultiView recognizes button controls with specific command names. <asp:Button ID="Button1" runat="server" CommandArgument="View2" CommandName="SwitchViewByID" Text="Go to View2" /> <asp:Button ID="Button1" runat="server" Text=“Prev“ CommandName="PrevView" /> <asp:Button ID="Button2" runat="server" Text="Next" CommandName="NextView" />
  • 11. Wizards represent a single task, and the user moves linearly through them, moving from the current step to the one immediately following it (or the one immediately preceding it in the case of a correction). The ASP.NET Wizard control also supports nonlinear navigation, which means it allows you to decide to ignore a step based on the information the user supplies.
  • 12. You can add as many WizardStep controls inside the Wizard as you want. Conceptually, the WizardStep plays the same role as the View in a MultiView. You place the content for each step inside the WizardStep control. <asp:Wizard ID="Wizard1" runat="server" ... > <WizardSteps> <asp:WizardStep runat="server" Title="Step 1"> ... </asp:WizardStep> <asp:WizardStep runat="server" Title="Step 2"> ... </asp:WizardStep> ... <WizardSteps> </asp:Wizard>