每次在asp.net中调试应用程序时如何获取登录页面 [英] how to get login page every time when we are debugging our application in asp.net

查看:56
本文介绍了每次在asp.net中调试应用程序时如何获取登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,
我正在做一个申请.我有10个表格.
例如newlead.aspx,newproduct.aspx,login.aspx.
如果我可以将起始页设置为newlead.aspx或其他某种形式,然后进行调试,那么我只想获取登录页.
怎么可能.


任何机构请对此提供帮助.

在此先感谢

sir,
i am doing one application.In that i am having 10 forms.
For example newlead.aspx,newproduct.aspx,login.aspx like that.
If i can set start page as newlead.aspx or some other form and then debug then i want to get the login page only.
How it''s possible.


Any body plz help about this.

thanks in advance

推荐答案

转到Solution Explorer.
Right click在登录文件(ex.login.aspx)上,然后单击Set AS Start Page.
Go to Solution Explorer.
Right click on the login file(ex.login.aspx) and click Set AS Start Page.


将Login.aspx设置为设置为起始页"
Set Login.aspx as "Set As Start Page"


在除登录页面之外的所有其他页面的页面负载上,检查会话变量.如果session为null,则将其重定向到login.aspx页.

放入页面加载的代码

On the pageload of all the other pages except login page, check for the session variable. If session is null redirect it to the login.aspx page.

Code to put in page load

if(Session["yoursessionkey"] == null)
    Response.Redirect("Login.aspx");



希望对您有帮助



Hope it helps


这篇关于每次在asp.net中调试应用程序时如何获取登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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