Re: Detect click on a link

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>
>


.



Relevant Pages

  • Detect click on a link
    ... I wanted to log a custom message when the user opens a link to a .pdf: ... in the .aspx file: ... Public Sub OnDownload ... It works (I have the log and the pdf is opened), but the problem is that by ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: .NET 2.0 Web App - streaming PDF
    ... I was able to use your code successfully to stream the PDF into the browser ... using Visual Web Developer Express. ... Dim stream1 As IO.FileStream ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: PDF Primary Hint Stream
    ... I have not clew what a hint stream is? ... of linearized PDFs on the web. ... Can we create a PDF sample from Acrobat and almost all the Linearized ...
    (comp.text.pdf)
  • RE: Stream pdf to browser
    ... from backend file or database and stream them to web application(let web ... application flush the pdf content to client). ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Need help with WebBrower Control
    ... I've not streamed from a string, I've only streamed PDF using ... Response.ContentType = "application/doc" for the Word file. ... stream into the WebBrowser control. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)