Help: Javascript for checking user

Discussion in 'ASP .Net' started by noor, Dec 24, 2005.

  1. noor

    noor Guest

    hi,
    can any one tell me a javascript that can be called on mouseover event of a
    html link control .
    script can check from session either a user is login or not
    In the case of Login it will redirect to the given url.
    In the case of not Login it will prompt the user that u r not login kindly
    login.

    actually that link leads a user to Download Software. but this feature is
    only for registerd user.

    kindly help me. it will be best if u give me a script for it.
    Thanks
    Noor
     
    noor, Dec 24, 2005
    #1
    1. Advertising

  2. noor

    Ahmed Fouad Guest

    Re: Javascript for checking user

    First of all JavaScript is not the correct way of implementing
    authentication in ASP.NET applications. So you should consider something
    which does not depend on the client browser to have JavaScript enabled so
    that your authentication scripts can run properly. What happens to your
    client-side authentication logic when someone has just disabled JavaScript
    in his/her browser?

    If you are using forms authentication (which will likely be the case), then
    after successful login u need to store some kind of user identity in
    SessionState so that you can tell whether the current request is
    authenticated or not. Once you have that piece of identity stored in
    SessionState its a matter of just one IF test against that identity to
    ensure that your download page is only accessible to authenticated users.
    Its a very basic and very common task in web-based applications. Try using
    the FormsAuthenticationModule (ideally with SSL enabled) for this purpose.
    This will make your application's authentication more robust. By using
    FormsAuthenticationModule you don't need to manually check for whether the
    request is authenticated or not. The module can be configured to
    automatically enforce request authentication and resource protection without
    writing a single line of code except checking against some kind of
    credential store (Active Director, DBMS, etc). Try searching MSDN for "Forms
    Authentication". You will certainly find some very nice articles written (by
    example) for demonstrating FormsAuthentication in action.

    Good Luck

    "noor" <> wrote in message
    news:%234ItDx$...
    > hi,
    > can any one tell me a javascript that can be called on mouseover event of
    > a
    > html link control .
    > script can check from session either a user is login or not
    > In the case of Login it will redirect to the given url.
    > In the case of not Login it will prompt the user that u r not login kindly
    > login.
    >
    > actually that link leads a user to Download Software. but this feature is
    > only for registerd user.
    >
    > kindly help me. it will be best if u give me a script for it.
    > Thanks
    > Noor
    >
    >
     
    Ahmed Fouad, Dec 24, 2005
    #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. Showjumper

    javascript for checking user

    Showjumper, Dec 23, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    383
  2. noor
    Replies:
    0
    Views:
    363
  3. KingBEE
    Replies:
    0
    Views:
    135
    KingBEE
    Apr 3, 2004
  4. noor

    JavaScript for checking user

    noor, Dec 24, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    95
  5. noor

    HELP :javascritp for checking user

    noor, Dec 24, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    97
Loading...

Share This Page