如果用户已经登录,则在同一浏览器中重定向到主页asp .net c#(Redirect to Home page if user already logged in, in same browser asp .net c#)

   IT问题网   2021-01-18 00:00:00

问 题

我想创建应用程序,如果用户在浏览器的一个选项卡中登录网站,如果他在第二个选项卡中打开应用程序,他不应该重定向到登录页面,但他应该重定向到主页。就像facebook或yahoomail在asp.net c#



请帮助

解决方案

设置你的主页是站点url中的默认页面和用于检查页面加载中的身份验证的代码,如果用户未登录,则会将主页重定向到登录页面







这样做的一种方法是



步骤1)在登录时间内为登录用户分配一个会话变量在登录页面



步骤2)检查每个页面加载上面的会话变量(检查会话变量是否为空)



步骤3)在注销时为会话变量赋值

你好pchindhade,



如果你正确使用会话,你不会遇到这样的问题。

详情请点击以下链接

点击我

更多查询只需发表评论。

玩得开心!!!

标签:如果用户已经登录同一浏览器定向主页



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

需要帮助来使用MySqlTransaction(Need help in using MySqlTransaction)

problem hi all i would like to use mysqltransaction in my ...

如何使用VBscript导航Windows注册表树(How to navigate Windows registry tree with VBscript)

problem does anyone know how to go about navigating the w ...

silverlight内存泄漏(silverlight memory leak)

problem hi, i was creating a dependencyproperty changed w ...

如何在json中获取单个元素(How to get single element in json)

problem in wcf service i am getting json response in that ...

双击文件打开程序,如何在c#中实现(double click on file opens program, how to implement in c#)

problem usually when a program in installed, you can clic ...

如何在我添加的现有数据表中添加新列,但它是bofore行的结尾(how add new column in existing datatable i added but its is come end of the bofore rows)

problem my datatable contans two columns id value ----- ...

如何在c#.net中的现有页面中打开新网址(How to open new url in existing page in c#.net)

problem hi to all, this is mdsiddiqali.i added new page n ...

DeleteObject方法不会删除任何内容 - 请帮忙。(DeleteObject method doesn't delete anything - please help.)

problem hello. i am trying to create method that will del ...

项目模板类型在C#中使用?(PROJECT TEMPLATE TYPE TO USE IN C#)

problem edit; okay i am creating a dock for programs to r ...

如何在我添加的现有数据表中添加新列,但它是bofore行的结尾(how add new column in existing datatable i added but its is come end of the bofore rows)

problem my datatable contans two columns ; id value ---- ...

在c#和asp.net中使用LinkedIn API?(Working with LinkedIn APIs in c# and asp.net )

problem hey i was trying to design an asp.net based webs ...

设计模式的案例研究(Case Studies for Design Pattern)

problem hi everyone, though i found "design patterns exp ...

返回所有组件(Retur all components)

problem dears, i need a method to return all named contro ...

Picturebox控件不会触发鼠标事件(Picturebox control not firing mouse events)

problem i have a picturebox control in a groupbox control ...

Windows 7中的VB.net + Crystall报告问题(VB.net + Crystall report issue in Windows 7)

problem i have created windows application in vb.net 2005 ...

如何将数据表中的数据保存回数据库?(How to save the data in a datatable back into the database)

problem i have filled my datatable with my sqladapter ass ...

测试ip和developpe ip扫描仪(Test ip and developpe ip scanner)

problem hi friends, i want help !!! i need c ...

在.Net中使用WCF的3层(3 tier using WCF in .Net)

problem hi, i have developed a 3 tier application in vb. ...

连续循环不循环(Continual Loop Not Looping)

problem j have code that is suppose to continue looping l ...

vb中的动态按钮控件(Dynamic button control in vb)

problem hi, i''ve a 10x10 matrix of buttons. i need to c ...