在添加动态元内容时使用 SWF 地址深度链接

发布于 2024-09-15 07:24:08 字数 844 浏览 1 评论 0原文

我有一个 Flash 站点,它从 URL 读取深层链接,然后使用 c# asp.net 读取 url 并为所请求的页面写入适当的元标记。

例如获取

www.domain.com/en-gb/scene4/subscene2

并将适当的元标记输出到页面

然后我们重定向到包含“#”的 swfaddress 友好页面

www.domain.com/#en-gb/scene4/subscene2

我尝试在 Webforms 和 MVC 中执行此操作,但两次都遇到问题..基本上我有点迷失了,可以提供一些建议或一个很好的例子获得灵感。

网络表单 使用 webforms,我需要为我可以接收的每个 url 路径组合创建一个 url 映射,或者使用 IIS 将所有 404 错误重定向到 default.aspx。

MVC 这似乎是一种更合适的路由 url 和获取值的方法,但是我最终会在我的 url 上加倍,否则我会丢失我的信息,例如

www.domain.com/en-gb/scene4/subscene2#en-gb/scene4/subscene2

这不能用作 url,而且当我创建太多路径时,我的 Flash 影片会停止显示。

阿贾克斯 我听说可能的另一种方法是仅使用带有 # 的 URL,而不是重定向,而是使用 Jquery 读取“#”后的路径,并使用 Ajax 调用从服务器端请求元数据。我还没有尝试过这条路。

I have a flash site which reads deep links from the URL, then using c# asp.net we read the url and write the appropriate meta tags for the page being requested.

e.g. GET

www.domain.com/en-gb/scene4/subscene2

and outputs appropriate meta tags to page

Then we redirect to the swfaddress friendly page containing the '#'

www.domain.com/#en-gb/scene4/subscene2

I have tried doing this in both webforms and mvc but run into problems both times..Basically I'm a bit lost and could do with some advice or a good example to get inspiration.

Webforms
with webforms I would need to create a url mapping for every combination of url paths i could receive or use IIS to redirect all 404 errors to default.aspx.

MVC
This seems a more appropriate way of routing the url and obtaining the values however I end up doubling up on my url else i lose my info e.g.

www.domain.com/en-gb/scene4/subscene2#en-gb/scene4/subscene2

this is not acceptable to use as a url, plus when i create too many paths my flash movie stops displaying.

Ajax
Another method I heard is possible is to only use the URLs with the # and not redirect but use Jquery to read the path after the '#' and an Ajax call to request the meta data from the server side. I haven't tried this path yet.

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

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

发布评论

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

评论(1

勿忘初心 2024-09-22 07:24:08

在 MVC 路线上解决了这个问题,我的问题是将 JavaScript 中的第二次重定向的 swf 电影定位到 /Content。现在看起来效果很好。在第二次重定向时,如果 # 存在,我不会更改 window.location,因为除非文化发生变化,否则我的模型存储在会话对象中。

Solved this on the MVC route, my problem was on targeting the swf movie on 2nd redirect in JavaScript to /Content. Appears to work well now. On second redirect I don't change window.location if # is present, as stored my model in a session object unless by culture changes.

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