使用ASP.NET查询登录 [英] Query on log in using ASP.NET

查看:85
本文介绍了使用ASP.NET查询登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想创建一个用户需要登录的网站,当他想要给出评分,写评论,购买项目时...假设用户在给出评级时登录......但他还需要登录再次当他点击购买项目因为我已经将它重定向到三个选项中的每一个的登录页面。如何避免它以便他登录一次并且可以做所有的事情?





SHOUTING删除 - OriginalGriff [/ edit]

suppose i want to make a website where an user needs to login when he wants to give ratings,write reviews,buy an item....suppose user logs in while giving ratings...but he also needs to log in again when he clicks on buy an item because i have redirected it to the log in page on each of the three options.How to avoid it so that he logs in once and can do all the things?


[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案

richcb是正确的应该只有登录一次。如果未登录且用户导航到需要登录的页面,则重定向它们。您可以在整个页面中使用会话来检查用户是否已登录。从用户名文本框中获取用户名并将其添加到会话中。如果该会话在尝试发表评论时为空,则重定向。



这是关于如何添加的链接如果您不知道怎么做,会帮助您。
richcb is correct there should only be one login. If not logged in and the user is navigating to a page that needs to be logged in then redirect them. You use session throughout the pages to check if the user is logged in. Grab the username from the username textbox and add it to the session. If that session is empty when they try to comment, then redirect.

Here''s a link on how to add to session that will help you if you don''t know how.


这篇关于使用ASP.NET查询登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆