AWd Unit 2
AWd Unit 2
List and
explain any three common properties of these controls.
Ans: Common Properties of listbox and dropdown list:
1. Items:
Both controls allow you to define a collection of items for the user to
select from.
ListBox uses Items property, and DropDownList uses Items or Item to
hold options.
2. SelectedIndex:
Represents the index of the currently selected item.
In both ListBox and DropDownList, the SelectedIndex property can be
used to get or set which item is selected.
3.SelectedValue:
4 text
Both ListBox and DropDownList allow you to get or set the text of the
selected item using the Text property.
3. AlternateText: The text will be displayed when image can not be displayed.
Ex. <AlternateText>Click here to explore great deals!</AlternateText>
4. Impressions: Describe the display rate of image or priority of image
Ex. <Impressions>150</Impressions>
5. Keyword :It is a category of Ad.
Ex <Keyword>electronics</Keyword>
Class
The AdRotator class has a number of properties. You can use the
AdvertisementFile property to set the advertisement file, and the Target
property lets you decide where the link will open (like in a new window or
the same window).
1. _blank
The link opens in a new unframed window.
2. _parent
The link opens in the parent of the current frame.
3. _self
The link opens in the current frame.
4. _top
The link opens in the topmost frame of the current window.
2. SelectedDate
Description:
If a single date is selected, this property shows the currently selected date.
If multiple dates are selected, it shows the first selected date.
3. SelectedDates
Description:
This property provides a collection of all the selected dates.
It is used to determine the selection features.
Code:
<asp:Calendar ID="MyCalendar" runat="server"
BorderColor="Black"
BorderStyle="Solid"
BackColor="LightGray"
ForeColor="Blue"
ShowToday="true"
ShowNextPrevMonth="true"
OnSelectionChanged="MyCalendar_SelectionChanged" />
<asp:Label ID="Label1" runat="server" Text="Selected Date will appear
here"></asp:Label>
Code Explanation:
ID="MyCalendar": The unique identifier for the calendar control.
BorderColor="Black": Sets the border color of the calendar.
BorderStyle="Solid": Defines the border style (solid line).
BackColor="LightGray": Sets the background color of the calendar.
ForeColor="Blue": Sets the text color for the calendar.
ShowToday="true": Displays the "Today" button that takes the user to
the current date.
ShowNextPrevMonth="true": Allows navigation between previous and
next months.
OnSelectionChanged="MyCalendar_SelectionChanged": Defines the
event handler that fires when a user selects a date.
Q sitemapcontrol
The **SiteMapPath control** is mainly used to navigate from one webpage to
another. It is a navigation control that shows a map of the site related to the
website's pages. This map displays the pages of that particular website and the
names of those pages. By clicking on those specific pages, users can navigate to
them.
We can say that the **SiteMapPath control** shows links to connect with other
pages' URLs. It provides breadcrumb navigation, meaning it shows the user's
current location and allows the user to navigate to higher-level pa
ges using the links.