In this article, we first briefly introduce the new site navigation mechanism provided by ASP.net 2.0, and note that the core of this new navigation function is to describe the navigation framework of the Web site in detail through an XML file. Obviously, the powerful features of this new navigation mechanism can greatly save programmers ' coding time. Next, we analyze the general idea of localization Web.sitemap by a simple example.
One, xml-based site map
The previous way to establish navigation in a Web application is to distribute a large number of hyperlinks on the page. But when developing large Web projects, this simple and primitive approach is extremely bloated and powerless. To this end, ASP.net 2.0 introduced a new navigation system to solve the whole problem. Although this new feature in ASP.net is very complex, we can control it from a wide range of method attributes that it provides.
This new navigation system defines the navigation system for the entire site through an XML file, which is called a site map. In this article, we want to skip over the basic discussion of this xml-based site map (Note: This article provides two sample projects, one of which is about displaying site maps based on XML, focusing on the localization of this new site navigation mechanism and providing a simple but complete sample project.
Localizing the system by modifying the resource file (. resx) is a good way to implement localization from desktop application development to ASP.net applications. Below, we will discuss this approach in detail.
II. building site Map-web.sitemap files for localization
You can apply localization directives to pages on ASP.net Web applications, or you can use the same ideas to complete localization tasks in Web.sitemap files.
Right-click Solution Explorer → add new Item ..., and then select the site Map template in the next Add New Item dialog box, as shown in the following illustration:
Figure 1. Create a site map file by clicking the site Map template