Dov
Dov

Reputation: 16186

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

How can I get the "SilverlightPage.aspx#" portion to look nicer, preferably removing the ".aspx#"?

Upvotes: 0

Views: 1411

Answers (2)

Jacob Adams
Jacob Adams

Reputation: 4004

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")));

Upvotes: 2

Bryant
Bryant

Reputation: 8670

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

Upvotes: 1

Related Questions