Re: Detect click on a link
- From: "Grant Merwitz" <grant@xxxxxxxxxxxxx>
- Date: Wed, 24 Aug 2005 16:38:58 +0100
What i would do.
Create a general page that can stream PDF's to users.
Link the user directly to this page.
In the beginning of the page, you can do whatever processing you need.
You can also stream the pdf to the user.
That way, if they right click and Save Target As, they will still recieve
the pdf, and you can log what you want.
If you wanting to do this on the same page, i can't see it working without
JavaScript which is causing your problems
HTH and Good Luck
"PL" <nomail@xxxxxxxxxx> wrote in message
news:430c778b$0$28863$636a15ce@xxxxxxxxxxxxxxx
> Hi
> I wanted to log a custom message when the user opens a link to a .pdf :
>
> in the .aspx file:
>
> <form runat="server">
> ...
> <a href="file.pdf" OnServerClick="OnDownload" runat="server">link</a>
> ...
> </form>
>
> in the .vb :
>
> Public Sub OnDownload(ByVal sender As Object, ByVal e As System.EventArgs)
> Dim anchor As HtmlAnchor
> ' write special log
> ...
> ' open link
> anchor=sender
> Response.Redirect(anchor.HRef)
> End Sub
>
>
> It works (I have the log and the pdf is opened), but the problem is that
> by
> this way I lose the real link. The link becomes
> "javascript:__dopostback(...)" and so the user can't download the pdf file
> with 'save as' menu action.
> How can I do to let the link be 'file.pdf' and log with server code when
> the
> user clicks it ?
>
> Thanks for any Help
>
> NL
>
>
.
- References:
- Detect click on a link
- From: PL
- Detect click on a link
- Prev by Date: Re: JavaScript with User Control
- Next by Date: Re: path related
- Previous by thread: Detect click on a link
- Next by thread: Session object is NULL in HTTP handler
- Index(es):
Relevant Pages
|