How to modify front of URL in Silverlight Navigation app?
My Silverlight application, using the navigation framework, has very pretty endings to its URLs, due to use of the URI mapping it does. But the front end still looks nasty, like:
http://server:port/SilverlightPage.aspx#/uri-mapped-portion
开发者_如何学CHow can I get the "SilverlightPage.aspx#" portion to look nicer, preferably removing the ".aspx#"?
You could use URL routing which is available as part of ASP.NET MVC or regular ASP.NET http://msdn.microsoft.com/en-us/library/cc668201.aspx
Edit: To answer your question in the comment:
I haven't worked with this myself, but if you look at the "Using routing with WebForms" section, it should explain it in detail. From what I gather you could use
routes.Add("SomeRoute", new Route("SilverlightPage",new CustomRouteHandler("~/SilverlightPage.aspx")));
You could use the default page instead of SilverlightPage so that it would be just:
http://server:port/#/uri-mapped-portion
Another way to get prettier pages is to use something like ASP.NET MVC which has pretty urls also. Then you could have something like:
http://server:port/Silverlight/App1/#/uri-mapped-portion
精彩评论