Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help: Javascript for checking user

Reply
Thread Tools

Help: Javascript for checking user

 
 
noor
Guest
Posts: n/a
 
      12-24-2005
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


 
Reply With Quote
 
 
 
 
Ahmed Fouad
Guest
Posts: n/a
 
      12-24-2005
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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking data before allowing user to move on D James ASP .Net 6 06-13-2007 07:01 PM
Help : javascript for checking user noor ASP .Net 0 12-24-2005 08:37 AM
JavaScript for checking user noor ASP .Net Web Controls 0 12-24-2005 08:36 AM
javascript for checking user Showjumper ASP .Net 2 12-24-2005 08:35 AM
How to differentiate PDA user and pc user by checking version of browser? KingBEE ASP .Net Web Controls 0 04-03-2004 05:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57