登录或注册之前,用户无法提交. [英] before login or registered the user can not submit.

查看:86
本文介绍了登录或注册之前,用户无法提交.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在一个有发布要求"页面的项目中工作.在此我希望用户不能在注册或登录之前发布任何要求.如果用户注册,则可以提交要求.否则在提交按钮上单击重定向以注册页面.












谢谢.


i am working on a project in which there is a page of "post requirement".here i want the user cannot post any requirement before registered or login.If user is registered than can submit the requirement.otherwise on submit button click redirect to register page.












Thank You.

推荐答案

您需要了解ASP.Net中身份验证的工作方式
Google对该主题有所了解并尝试学习.
http://msdn.microsoft.com/en-us/library/xdt4thhy.aspx [ ^ ]
You need to learn how authentication works in ASP.Net
Google a bit about the topic and try to learn.
http://msdn.microsoft.com/en-us/library/xdt4thhy.aspx[^]


首先,您应该在页面中设置验证器以验证控件和
如果提交成功,则始终将用户名存储在会话对象中.提交数据后重定向到第二页.在第二页中,您必须检查会话对象是否不为空.如果为空,则重定向到登录页面.

在此页面中,匿名用户无法间接打开您的页面.
First of all you should set validator in you page to validate your controls and
always store the username in session object if submits successfully. after submitting data redirect to second page. In second page you must check the session object whether it is not empty. If empty redirect to login page.

In this page Anonymous User cannot open you pages indirectly.


这篇关于登录或注册之前,用户无法提交.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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