Asp.net MVC learning diary thirteen (page navigation)

Source: Internet
Author: User

Preparation go to http://mvcsitemap.codeplex.com/download mvcsitemapprovider. dll

1. Add mvcsitemapprovider. DLL to the project reference.

2. In web. config, The system. Web Node

<Sitemap defaultprovider = "mvcsitemapprovider" enabled = "true">
<Providers>
<Clear/>
<Add name = "mvcsitemapprovider"
Type = "mvcsitemapprovider. defaultsitemapprovider, mvcsitemapprovider"
Sitemapfile = "~ /MVC. sitemap"
Securitytrimmingenabled = "true"
Cacheduration = "5"
Enablelocalization = "true"
Scanassembliesforsitemapnodes = "true"
Skipassemblyscanon = ""
Attributestoignore = "bling"
Nodekeygenerator = "mvcsitemapprovider. defaultnodekeygenerator, mvcsitemapprovider"
Controllertyperesolver = "mvcsitemapprovider. defaultcontrollertyperesolver, mvcsitemapprovider"
Actionmethodparameterresolver = "mvcsitemapprovider. defaultactionmethodparameterresolver, mvcsitemapprovider"
Aclmodule = "mvcsitemapprovider. defaultaclmodule, mvcsitemapprovider"
Sitemapnodeurlresolver = "mvcsitemapprovider. defaultsitemapnodeurlresolver, mvcsitemapprovider"
Sitemapnodevisibilityprovider = "mvcsitemapprovider. defaultsitemapnodevisibilityprovider, mvcsitemapprovider"
/>
</Providers>
</Sitemap>

3. Create a site map file MVC. sitemap

<? XML version = "1.0" encoding = "UTF-8"?>
<Mvcsitemap xmlns = "http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-2.0" enablelocalization = "true">
<Mvcsitemapnode Title = "home" Controller = "home" Action = "Index" changefrequency = "always" updatepriority = "normal">
<Mvcsitemapnode Title = "Edit person" Controller = "home" Action = "edit"/>
</Mvcsitemapnode>
</Mvcsitemap>

4. Add edit action and empty View

Access http: // localhost: 1142/home/edit to see the effect.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.