Question

I'm aware that ASP.Net Request.Url cannot give me deep linking url generated by SWFAddress.

http://www.mysite.com/Default.aspx#/6/

ASP.Net Request.Url only returns

http://www.mysite.com/Default.aspx

I found one question but it is quite old - SWFAddress Deeplinks and C# library?

Is there any library/technique to access deep linking url from Server Side?

Thanks!

Updated: Here is what I get when I access /Default.aspx#/6/

? Request.Url
{http://localhost:56476/Default.aspx}
    AbsolutePath: "/Default.aspx"
    AbsoluteUri: "http://localhost:56476/Default.aspx"
    Authority: "localhost:56476"
    DnsSafeHost: "localhost"
    Fragment: ""
    Host: "localhost"
    HostNameType: Dns
    IsAbsoluteUri: true
    IsDefaultPort: false
    IsFile: false
    IsLoopback: true
    IsUnc: false
    LocalPath: "/Default.aspx"
    OriginalString: "http://localhost:56476/Default.aspx"
    PathAndQuery: "/Default.aspx"
    Port: 56476
    Query: ""
    Scheme: "http"
    Segments: {string[2]}
    UserEscaped: false
    UserInfo: ""

Update: I'm sorry that I did not make my question clear. If user browsers the following url (mostly likely saved in favorite), I would like to retrieve the full url from server side. You can go to that url; it is a real app.

http://publ.com/Kgd3A5y#/13/zoomed

My Current Solution: I subscribe an event (let say page load) at client side. I parse the url at client side, and return to server using ajax. Disadvantage is it creates two page loads.

Was it helpful?

Solution

Part of URL with # is anchor. Anchors are only visible on the client side. You need to deal with anchors on client side with for example JavaScript and You can transform Your request to proper URL readable on server side.

This is not Asp.Net or C# specific. It is standard behavior for any server technology.

Just to quote standard RFC1808:

Note that the fragment identifier (and the "#" that precedes it) is not considered part of the URL.

Update:

If You want to send some data from Your swf to server You can write web service on the server side and then swf can communicate with this web service, so You can send whatever data You like.

Client side JavaScript would be fine to send URL to web service as well.

Edit:

Mate You got plenty of requests already:

81 requests ❘ 1.37MB transferred ❘ 24.10s (onload: 2.41s, DOMContentLoaded: 2.17s)

, so sending few bytes with asynchronous request would not make any difference I think.

Besides I do not think there is much You can do. Anchor is entirely client side thing, it's NOT part of the URL, and to deal with it You need to process on the client side and to process on the client side You need to load Your client script from server, end of story.

There is socket communitacion avaliable in Flash, but it's overdo and You mentioned that You have no access to swf code.

Really I can see no reason to change what You have and no good alternative as well.

OTHER TIPS

Nope, this is not deep linking. You are talking about local anchors. Something totally different.

Your problem needs to be re-defined and then it can be understood. You problem is not deep linking. Your problem is that a local program is generating a local value (anchor) for local work.

If you need this information on the server side (and given our new definition on the surface it would seem you would not -- local work and data expects to be local), then you need to do one of two things.

  1. REDEFINE your requirements and design to not perform these functions locally.

  2. IMPLEMENT communication between local process and your server to communicate this information.


Based on the comment and thinking about this problem:

You can implement a solution easy with the following change to your requirements (#1 above)

Instead of using link that look like this

http://www.mysite.com/Default.aspx#/6/

Use links that look like this

http://www.mysite.com/Default.aspx/6/

or

http://www.mysite.com/Default.aspx?6/

These are actual "deep links" and the server side will be able to see them, your library will also be able to handle them. (Based on the quick scan of the documentation you linked to.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top