开发者

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
开发者_如何学C

How 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜