Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 116

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

1124 CHAPTER 24 Advanced Navigation Remapping URLs The simplest way to remap a URL is to specify the remapping in your application’s web configuration file. For example, the web configuration file in Listing 24.1 remaps the Home.aspx page to the Default.aspx page. LISTING 24.1 Web.Config The configuration file in Listing 24.1 contains a element. This element can contain one or more elements that remap a page from a URL to a mapped Url. The mappedUrl attribute can contain query strings. However, it cannot contain wildcards. You can use the element only when performing simple page-to-page mappings. After. | 1124 CHAPTER 24 Advanced Navigation Remapping URLs The simplest way to remap a URL is to specify the remapping in your application s web configuration file. For example the web configuration file in Listing 24.1 remaps the Home.aspx page to the Default.aspx page. LISTING 24.1 Web.Config xml version 1.0 configuration system.web urlMappings add url Home.aspx mappedUrl Default.aspx urlMappings system.web configuration The configuration file in Listing 24.1 contains a urlMappings element. This element can contain one or more elements that remap a page from a URL to a mapped Url. The mappedUrl attribute can contain query strings. However it cannot contain wildcards. You can use the urlMappings element only when performing simple page-to-page mappings. After you add the web configuration file in Listing 24.1 to your application any requests for the Home.aspx page are modified automatically to requests for the Default.aspx page. It doesn t matter whether the Home.aspx page actually exists. If the Home.aspx page does exist you can never open the page. NOTE The tilde character has a special meaning when used with a path. It represents the current application root. A forward slash at the start of a URL on the other hand represents the website root. You can use the tilde only with properties of ASPNET controls. For example you can use it with the ASPNET Image control s ImageUrl property but you cannot use it with the HTML img src attribute. In code you can use the tilde character with a path by using the Page.ResolveUrl method. This method automatically expands the tilde to the application root. When working with remapped URLs you often need to determine the original URL that a user requested. For example you might want to display a message that tells users to update their bookmarks favorites to point to the new URL. From the Library of Wow eBook Remapping URLs 1125 You can use the following to determine the current URL Request.RawUrl Returns the original URL before being .

TÀI LIỆU LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.