![]() |
Help: Javascript for checking user
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 |
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" <noorali@sctbpo.com> wrote in message news:%234ItDx$BGHA.3744@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 > > |
| All times are GMT. The time now is 12:43 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.