没有登录的C#会话问题 [英] C# session Problem without Log in

查看:76
本文介绍了没有登录的C#会话问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的求职者主页上有求职标准,现在我想开发这样的逻辑,

当求职者搜索工作,工作数据打开并且从该求职者可以看到工作页面的详细视图但是当他/她尝试申请工作时它要求登录页面,一旦登记由求职者完成它不请求在搜索时再次登录。

就像在每个职位门户网站一样,



我成功直到要求登录,但它要求每当求职者尝试申请时登录,如果我使用会话而不是它给出错误,因为最初没有登录。所以我不能使用会话。



so plz帮我完成这段代码。

Hi all,

I have job search criteria in my home page for job seeker, now I want to develop logic like that,
when jobseeker search jobs, job datalst is opened and from that jobseeker can see detail view of job page but when he/she try to apply for a job it ask for log in page, once log in is done by job seeker its not ask for log in again while searching.
Like in every job portal,

I succeed till ask for a log in , but it ask log in every time when job seeker try to apply,if i use session than it gives error because log in is not done initially.so I cant use session.

so plz help me to complete this code.

推荐答案

你必须分享你所做的事情,以便我们建议改变。但是,您可以将所有安全页面放在某个文件夹中,然后使用web.config中的location元素在这些页面上使用表单身份验证。这样.Net将为您处理逻辑,您只需实现表单身份验证。
You would have to share what you have done so we could suggest a change. However, you could put all of your "secure" pages in a certain folder and then use the location element in web.config to use forms authentication just on those pages. That way .Net will handle the logic for you and you just have to implement Forms Authentication.


内部应用按钮单击事件,只检查会话是否存在。

如果会话存在,则允许用户申请,否则请求登录。



因此,在登录时,只需设置会话。当用户再次单击应用按钮时,它将找到会话并允许应用。
Inside Apply Button Click Event, just check if Session Exists or not.
If Session Exists, then allow user to apply, else Ask for Login.

So, at the time of Login, just set the Session. When user again clicks on Apply Button, it will find the Session and allow to apply.


这篇关于没有登录的C#会话问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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