By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,963 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,963 IT Pros & Developers. It's quick & easy.

Help: Javascript for checking user

P: n/a
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
Dec 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <no*****@sctbpo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Dec 24 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.