Authorize before download a file in asp.net

Discussion in 'ASP .Net' started by Ben Chen, Oct 11, 2004.

  1. Ben Chen

    Ben Chen Guest

    Could any one tell me how to deal with the following problem:

    If user has not login the system, when he click the url for downloading a
    file he will be re-direct to the
    login page. Just as I download the sample code in Codeproject.com.

    Thanks all
    Ben Chen, Oct 11, 2004
    #1
    1. Advertising

  2. Hi Ben,
    I am not sure how it is Done Code Project, but a simple logic whihc i can
    derive is have the LinkButton on the webpage for downloading, when the user
    clicks on the download link. in the LinkButton_Click event Check for the
    Valid User something like
    if(Session["UserName"].ToString().Length<=0)
    Server.Transfer("Login.aspx");
    else
    Response.write("<Script>location.href='Download.zip'</script>");

    Hope this works for you i do remember doing this a long time back.. i do not
    have the code right now.

    but this will have impact on the post back!!

    so the Redirecting


    "Ben Chen" wrote:

    > Could any one tell me how to deal with the following problem:
    >
    > If user has not login the system, when he click the url for downloading a
    > file he will be re-direct to the
    > login page. Just as I download the sample code in Codeproject.com.
    >
    > Thanks all
    >
    >
    >
    =?Utf-8?B?UHJhdmVlbiBL?=, Oct 11, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Blue

    Problem with Authorize.net

    Blue, Dec 28, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,168
    Chris Gunn
    Dec 30, 2005
  2. Bobby Edward

    Authorize.NET SIM Implementation

    Bobby Edward, Jan 19, 2009, in forum: ASP .Net
    Replies:
    9
    Views:
    685
    George
    Jan 21, 2009
  3. Lakshman

    Authorize.net integration problem

    Lakshman, Mar 31, 2009, in forum: Python
    Replies:
    2
    Views:
    287
    Stephen Chapman
    Mar 31, 2009
  4. lenyado

    How to authorize download?

    lenyado, Dec 25, 2004, in forum: ASP .Net Security
    Replies:
    4
    Views:
    445
    Lenyado
    Dec 29, 2004
  5. Authorize.net AIM ASP Script

    , Mar 19, 2005, in forum: ASP General
    Replies:
    0
    Views:
    104
Loading...

Share This Page