如何修改 Silverlight 导航应用程序中 URL 的前面?

发布于 2024-08-14 09:02:14 字数 216 浏览 1 评论 0原文

我的 Silverlight 应用程序使用导航框架,由于使用了 URI 映射,其 URL 结尾非常漂亮。但前端看起来仍然很糟糕,比如:

http://server:port/SilverlightPage.aspx#/uri-mapped-portion

如何让“SilverlightPage.aspx#”部分看起来更好,最好删除“.aspx#”?

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#"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

病女 2024-08-21 09:02:14

您可以使用 URL 路由,该路由作为 ASP.NET MVC 或常规 ASP.NET 的一部分提供
http://msdn.microsoft.com/en-us/library/cc668201。 aspx

编辑:回答您在评论中的问题:

我自己没有处理过这个问题,但是如果您查看“在 WebForms 中使用路由”部分,它应该详细解释它。据我收集,你可以使用

routes.Add("SomeRoute", new Route("SilverlightPage",new CustomRouteHandler("~/SilverlightPage.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")));
审判长 2024-08-21 09:02:14

您可以使用默认页面而不是 SilverlightPage,这样它就只是:

http://server:port/#/uri-mapped-portion

另一种方法获得更漂亮的页面是使用像 ASP.NET MVC 这样的东西,它也有漂亮的网址。然后你可以有类似的东西:

http://server:port/Silverlight/App1/#/uri -映射部分

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文