1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu về Lập trình C - Chương 1

24 9 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 24
Dung lượng 368,67 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Tài liệu giảng dạy về ASP.net đã được giảng dạy với mục đích cung cấp cho sinh viên những kiến thức cơ bản nhất, có tính hệ thống liên quan tới lập trình. Thông qua cuốn tài liệu này, chúng tôi muốn giới thiệu với các bạn đọc về kỹ năng lập trình cơ bản.Mời các bạn cùng tham khảo

Trang 1

Môn học: Lập trình ASP.NET

ASP.NET Navigation

TRƯỜNG ĐẠI HỌC KHOA HỌC TỰ NHIÊN

KHOA CÔNG NGHỆ THÔNG TIN

BỘ MÔN CÔNG NGHỆ PHẦN MỀM

Trang 3

ASP.NET Navigation

quan tâm là việc xây dựng cấu trúc của Website (organization structure)

là sitemap

3

Trang 4

XML Site map

4

Trang 5

Site Navigation

 Các Sitemap control dùng để hiển thị site map

5

Trang 6

Site Navigation Schema

Site Navigation API

Trang 7

XML Site map

định nghĩa cấu trúc website thông qua các external data source.

mapping này có thể là các XML file, database…

7

Trang 8

8

Trang 9

9

<?xml version="1.0" encoding="utf-8" ?>

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<siteMapNode url="" title="" description="">

<siteMapNode url="~/Default.aspx" title="Trang Chủ" description="Trang Chủ" >

<siteMapNode url="~/Gallery.aspx" title="Gallery" description="Gallery" />

<siteMapNode url="~/ContactUs.aspx" title="Liên hệ" description="Liên hệ" />

</siteMapNode>

</siteMap>

Trang 11

Cấu hình SiteMap File

Trang 12

SiteMapPath Control

chủ) đến node hiện tại (breadcrumb)

12

Trang 13

Stylizing SiteMapPath

<asp:SiteMapPath Font-Name="Verdana" Font-Size="10pt" RunAt="server">

<CurrentNodeStyle Height="24px" BackColor="Yellow" Font-Bold="true" />

Trang 14

Key SiteMapPath Properties

CurrentNodeStyle Style used to render the current node

CurrentNodeTemplate HTML template used to render the current nodeNodeStyle

Trang 15

Orientation="Horizontal" StaticDisplayLevels="2" StaticSubMenuIndent="10p

x

Trang 17

Declaring a TreeView

<asp:TreeView RunAt="server>

<Nodes>

<asp:TreeNode Text="Training" RunAt="server">

<asp:TreeNode Text="Programming NET" RunAt="server"

Trang 18

Key TreeView Properties

ShowExpandCollapse Specifies whether expand/collapse indicators are shownExpandDepth Specifies the TreeView's initial expand depth

LevelStyles Specifies appearance of nodes by level

RootNodeStyle Specifies appearance of root nodes

LeafNodeStyle Specifies appearance of leaf nodes

SelectedNodeStyle Specifies appearance of selected nodes

HoverNodeStyle Specifies appearance of nodes when cursor hovers overheadNodeStyle Specifies default appearance of nodes

Trang 19

TreeViews and Site Maps

<asp:SiteMapDataSource ID="SiteMap" RunAt="server" />

<asp:TreeView DataSourceID="SiteMap" RunAt="server" />

<siteMap>

<siteMapNode title="Home" description="" url="default.aspx">

<siteMapNode title="Training" url="Training.aspx"

description="Training for NET developers">

<siteMapNode title="Programming NET" url="Classes.aspx?id=1"

description="All about the NET Framework" />

<siteMapNode title="Programming ASP.NET" url="Classes.aspx?id=2"

description="All about ASP.NET" />

<siteMapNode title="Programming Web Services" url="Classes.aspx?id=3" description="All about Web services" />

</siteMapNode>

</siteMap>

Web.sitemap

Trang 21

Thay đổi Default sitemap file

Trang 22

Security Trimming

<siteMap>

<siteMapNode title="Home" description="" url="default.aspx">

<siteMapNode title="Announcements" url="Announcements.aspx"description="Information for all employees" roles="*" />

<siteMapNode title="Salaries" url="Salaries.aspx"

description="Salary data" roles="Managers,CEOs" />

Trang 23

Enabling Security Trimming

Trang 24

Sử dụng đối tượng Sitemap

// Write the title of the current node to a Label control

Label1.Text = SiteMap.CurrentNode.Title;

// Write the path to the current node to a Label control

SiteMapNode node = SiteMap.CurrentNode;

StringBuilder builder = new StringBuilder (node.Title);

while (node.ParentNode != null) {

Ngày đăng: 20/05/2021, 03:44

w