sitemap

How can I remove nodes from a SiteMapNodeCollection?

坚强是说给别人听的谎言 提交于 2019-12-02 05:43:26
I've got a Repeater that lists all the web.sitemap child pages on an ASP.NET page. Its DataSource is a SiteMapNodeCollection . But, I don't want my registration form page to show up there. Dim Children As SiteMapNodeCollection = SiteMap.CurrentNode.ChildNodes 'remove registration page from collection For Each n As SiteMapNode In SiteMap.CurrentNode.ChildNodes If n.Url = "/Registration.aspx" Then Children.Remove(n) End If Next RepeaterSubordinatePages.DataSource = Children The SiteMapNodeCollection.Remove() method throws a NotSupportedException: "Collection is read-only". How can I remove the

ASP.NET URL Routing with WebForms - Using the SiteMap

♀尐吖头ヾ 提交于 2019-12-02 00:30:25
I'm trying to use Url Routing within my existing ASP.NET WebForms site. Thanks to: this link , I got it working. Now I'm trying to use a SiteMap along with my routing. I have a page MyReport.aspx. It is in the SiteMap and accessing the page directly, works fine. I've added a route for /report/{param1}/{param2}. I was hoping the sitemap would resolve the route path (MyReport.aspx) instead of /report/{param1}/{param2}, but no dice. I have seen examples of using the SiteMap with MVC , but this makes assumptions about having controllers and such, none of which exist with a standard webform. The

SiteMap HtmlHelper ASP.NET MVC

故事扮演 提交于 2019-12-01 23:10:08
问题 I've rewritten this post to make it more simple. This is the code I've got (a HtmlHelper ): using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Runtime.CompilerServices; using System.Web.Mvc; using System.Text; using System.Web.Routing; namespace Intranet.Helpers { public static class MenuHelper { private static string GetBackLink(SiteMapNode parentNode) { return "<li class='li-back'><a href='" + parentNode.Url + "' title='" + parentNode.Title + "

Dynamically built SiteMapPath in asp.net

元气小坏坏 提交于 2019-12-01 19:37:05
I'm trying to build a dynamic site map on my site using SiteMapPath. Should be like this: Home > Products > %product_name% > Prices where %product_name% is set dynamically in the runtime, depending on the user's choice. I've read many articles on the theme and choose this http://harriyott.com/2007/03/adding-dynamic-nodes-to-aspnet-site.aspx . It dynamically changes the web.sitemap XML file. The problem is that it still builds the sitemap only once in the beginning and then uses it on each page. How can I make it to rebuild on each loaded page? Arrabi Try this: Right click on your project "add

Does Google ignores whatever is after the hash fragment (#) while crawling our website?

假装没事ソ 提交于 2019-12-01 18:08:47
问题 We are using the information that is after the hash fragment to display different pages using JavaScript, in order not to force the browser to load the whole page again. For example a direct link to the page could look like this (book_id/page_id): www.example.com/book#1234/5678 Since we don't have direct links to each page but to the books, we are thinking to add these direct links into sitemap.xml. My question is wether Google is considering that as a separate link or just ignoring

Scrapy crawl all sitemap links

让人想犯罪 __ 提交于 2019-12-01 14:23:05
I want to crawl all he links present in the sitemap.xml of a fixed site. I've came across Scrapy's SitemapSpider . So far i've extracted all the urls in the sitemap. Now i want to crawl through each link of the sitemap. Any help would be highly useful. The code so far is: class MySpider(SitemapSpider): name = "xyz" allowed_domains = ["xyz.nl"] sitemap_urls = ["http://www.xyz.nl/sitemap.xml"] def parse(self, response): print response.url You need to add sitemap_rules to process the data in the crawled urls, and you can create as many as you want. For instance say you have a page named http:/

How to write python scrapy code for extracting url's present in sitemap of a site

ぐ巨炮叔叔 提交于 2019-12-01 10:00:38
问题 I'm trying to use this code to get list of urls in sitemap. when i run this, i see no results in the screen. could anyone tell me whats the problem or suggest me better one with good example. thanks in advance class MySpider(SitemapSpider): name = "xyz" allowed_domains = ["xyz.nl"] sitemap_urls = ["http://www.xyz.nl/sitemap.xml"] def parse(self, response): print response.url return Request(response.url, callback=self.parse_sitemap_url) def parse_sitemap_url(self, response): # do stuff with

ASP.NET MVC: Keeping last page state

风流意气都作罢 提交于 2019-12-01 06:22:05
Here's the situation: i have a SearchPage where an user can make a complex search. Nothing really unusual. After the results are displayed, the user can select one of them and move to another Page (Like a Master/Detail). I have a breacrumb which holds the places where the user has been and it can have more than 4 levels (Like Main -> 2Page -> 3Page -> 4Page -> NPage). What i want is to maintain the state of each control on my complex search page, if the user uses the breacrumb to navigate backwards, since i don't want them to manually set all those search filters again. So far, i've been using

Sitemap Error : XML declaration allowed only at the start of the document解决方法

南楼画角 提交于 2019-12-01 01:57:15
  今天ytkah的客户反馈说他的xml网站地图有问题,提示Sitemap Error : XML declaration allowed only at the start of the document,这个很大的可能是wp-config.php或主题function.php文件中有多余的 空格/空行 ,打开他的function.php看了一下,发现在最后加了一些定义 <?php remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); ?>   这个是另起了一个<?php ?>,试着把它去掉,然后把remove定义放到前面的封装里,保存上传覆盖,更新缓存,更新cdn,再访问一下xml网站地图不会出现前面的错误提示了。   参考资料However, the cause most often is an empty line at the beginning (before the <?php line) or end of the wp-config.php or functions.php file. If there is no empty line in these files, we highly recommend running a conflict

XSLT - Replace apostrophe with escaped text in output

女生的网名这么多〃 提交于 2019-11-30 23:41:13
I'm writing an XSLT template that need to output a valid xml file for an xml Sitemap. <url> <loc> <xsl:value-of select="umbraco.library:NiceUrl($node/@id)"/> </loc> <lastmod> <xsl:value-of select="concat($node/@updateDate,'+00:00')"/> </lastmod> </url> Unfortunately, Url that is output contains an apostrophe - /what's-new.aspx I need to escape the ' to &apos; for google Sitemap. Unfortunately every attempt I've tried treats the string ' &apos; ' as if it was ''' which is invalid - frustrating. XSLT can drive me mad sometimes. Any ideas for a technique? (Assume I can find my way around XSLT 1.0