.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

url rewriting and sitemap

Posted By:      Posted Date: October 17, 2010    Points: 0   Category :ASP.Net

Hi. I'm using iis7 url rewrite module and make user friendly urls. But in my sitemap this is not like that.

It has like .aspx?id=123&category=dasd

Is it problem or not? or what can I do?

View Complete Post

More Related Resource Links

URL Rewriting

If you click on the link you can have look at how the URL rewriting is working. It can be easily understand with screen shot!!!


URL rewriting with webserver in VS.NET2010



is it possible to have same URL rewriting behaviour in integrated webserver as in "real" IIS7?


postbacks and url rewriting


Hi all,

I am using Intelligencia url rewriter for my project and have run in a small problem. I have a regular expression like

<rewrite url="~/(.+)/(.+)/(.+).aspx" to="~/Article.aspx?a=$3&amp;s=$2&amp;p=$1"/>

so a page request like

/parent/category/articlename.aspx is interpreted as /Article.aspx?a=articlename&s=category&p=parent.

This above is all fine, but now when I do a postback (a login block), it picks up the url /Article.aspx?a=articlename&s=category&p=parent and interprets as /Article.aspx?a=article&s=category&p=parent.

Now, how can I make sure that on the postback, it still throws back the original url /parent/category/articlename.aspx so that the url is properly interpreted?


css and images gone on url rewriting


 I have a program which rewrites a url to a form     website.com/Default.aspx/name/articleid

The Program works fine ,but after URL rewriting my css sheet and images are gone . 

I am new to this and I have read that I should map my css and images to root. 

So ,I hav done some change to the path files of css and images but it stilll doesnt work .

Plz help me over this ...... 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TBV.aspx.cs" Inherits="TBV" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Article Page</title>
    <link rel="index" href="~/" title="Home" />
    <link rel="Stylesheet" media="screen,projection" type="text/css" href="~/css/main.css" />
    <link rel="stylesheet" media="print" type="text/css" href="~/css/print.css" />
    <link rel="stylesheet"

Custom Control Design-Time SiteMap Provider Error


Greetings - I was referred here by MSDN forums hope this is the right place -  

I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains

Error Creating Control - MyControl  The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

I have discovered that the error is cause by this line of code:

string div = string.Format("<div class='{0}' id='{1}'>{2}</div>", this.CssClass, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level));

or more specifically, by the reference to SiteMap.RootNode - I am not clear what is missing thoough because I have configured the SiteMapProvider in web.config as this:

        <add name="AspNetXmlSiteMapProvider" 
             type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

Security Briefs: Protect Your Site With URL Rewriting


Learn the numerous ways in which you can rewrite URLs to defend against common Web vulnerabilities.

Bryan Sullivan

MSDN Magazine March 2009

ImageURL SiteMap Node


Hi Can anyone tell me how i can add the ImageURL from a sitemap into a navigation menu, i had this working with webforms but cannot get it to work with mcv

var sbMenuHelper = new StringBuilder();

sbMenuHelper.Append("<ul class='cssMenu'>");

var topLevelNodes = SiteMap.RootNode.ChildNodes;
foreach (SiteMapNode node in topLevelNodes)
    if (SiteMap.CurrentNode == node)
        sbMenuHelper.AppendFormat("<a href='{0}'>{1}</a>", node.Url, helper.Encode(node.Title));

return sbMenuHelper.ToString();

        description="Contact Us"

Linq Save to ror.xml or other sitemap.xml


Hi there, 

I'm trying to make a script for a site, that updates the sitemaps in the background.

I didn't create this site, and someone before me added in the ror.xml and sitemap.xml and urllist.txt files.

I want to update these all at the same time. If the url is not in there already of course...

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:ror="http://rorweb.com/0.1/" >
  <title>ROR Sitemap for http://www.envirospec.co.nz/</title>

Trying to get to a page via an email link. Could the sitemap be stopping this?


I had this working.  I would email a link to a page (i.e. Work.aspx), and using the code below, the user would be routed to the login page and then sent  to Work.aspx after logging in.

But since I added a site map this isn't working.  I always go directly to my home page.  If I set Work.aspx as my start page in VS it works, but not if I click a link in the email.

Any thoughts?

 protected void Page_Load(object sender, EventArgs e)


        if (!Page.User.Identity.IsAuthenticated)

            Response.Redirect("~/Login.aspx" + "?ReturnUrl=~/Work.aspx");


    protected void Page_Load(object sender, EventArgs e)
        if (!Page.User.Identity.IsAuthenticated)

sitemap control user rights enable and disable



iam using masterpage and sitemap in my project, what i want to is that

if user login is did, based on the user previlage in need to show the sitemap menu page

if user i have the previlage to see the page then i should enable that page otherwise

i need disable that page

looking for the valuable suggestions

Sitemap issue

Hello, This question pertains to the web.sitemap and the sitemap control. I have the following entry in the web.sitemap:<siteMapNode url="Default.aspx" title="Home" description=""> <siteMapNode url="" title="Articles" description=""> <siteMapNode url="~/TBSArticles/ShowCategories.aspx" title="Categories" description="" /> <siteMapNode url="~/TBSArticles/ProductShowCase.aspx" title="Product Showcase" description="" /> <siteMapNode url="~/TBSArticles/ProductReview.aspx" title="Product Review" description="" /> </siteMapNode> </siteMapNode> </siteMap> The Home and Article texts show as separate tabs on the menu control. Under Article, "Categories", "Product Showcase" and  "Product Review" show as drop down menus. When I click on "Categories" the site map control shows "Home -> Article -> Categories", and the ShowCategories.aspx page is displayed on the browser . The ShowCategories.aspx page has several links. When any one is clicked it it leads to the BrowseArticles.aspx page with an unique querystring value. The problem is that at this stage, the sitemap becomes blank an

URL Rewriting Dynamic

Hi, i am  having problem with the below urls to rewrite. http://www.mywebsite.com/products.php?shprod=345http://www.mywebsite.com/products.php?cat=cars  i want them to be displayed http://www.mywebsite.com/products/345http://www.mywebsite.com/products/cars i want to take query string based on the requested. but it is taking  the secong one, How to differenciate the Query string whether it is "shprod" or "cat" Please give me solution

URL Rewriting subdomains

Hi. I'm trying to create a mini-blog for some users which would use http://name.mydomain.ext form for access. Is it possible to use URL rewriting to transfer http://name.mydomain.ext to http://mydomain.ext/userarea.aspx?user=name. Thanks.

Create sitemap

I have to create a sitemap for my website in asp.net 2.0. Can anybody tell me the procedure for the same.I am totally new to this concept.. 

How to access querystring values from javascript after url rewriting?

Hi mates, I´m using ASP.NET 3.5 with C#. The problem that I have is the following. I´m using url rewriting (in the Global.asax file) and people see urls like this:http://localhost:1855/uk/london but after I rewrite the urls I work internally with querystring values and the urls become somehting like this:http://localhost:1855/post.aspx?co=1&ci=1In my Global.asax after I create the proper url with the querystring values I just apply it with the following sentence (this is an example):Context.RewritePath("/post.aspx?co=1&ci=1");The problem is that from javascript using the following function I access the first url and not the second:function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } } I need to access the querystring values because I need to load values in a textbox using jQuery.autocomplete and Web Services. Can anyone tell me how to access the rewritten url to get the querystring values?Thanks in advance mates

URL routing with a dynamic .sitemap file

Hi,I've implemented URL routing now I've upgraded to .NET 4 following http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx.The only problem I've encountered is with the .sitemap file. If I put, for example: <siteMapNode url="~/recipes/Starters" title="Browse Starters"> it renders correctly. However, I need to do something like this: <siteMapNode url="~/recipes/{category}" title="Browse {category}"> - i.e. dynamically giving a titleOr, I'd settle for something like this: <siteMapNode url="~/recipes/*" title="Browse Recipes"> - i.e. covering all recipe pages Has anyone found a nice solution to this?

localization sitemap on MasterPage

Hi Everyone, i am new in localization.I need to create a website in dual language.I plan to put the sitemap and change language dropdownlist in the master page.May anyone advice on how to i change the sitemap language at treeview and Menu on master page?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend