首先我添加了一个Web 用户控件,并添加一个HeadLink图片,代码如下:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HeadLink.ascx.cs" Inherits="HeadLink" %>
<asp:ImageMap ID="ImageMap1" runat="server" ImageUrl="~/Image/HeadLink.jpg"
Width="800px">
<asp:RectangleHotSpot Bottom="30" Left="0" NavigateUrl="system.aspx" Right="159" />
<asp:RectangleHotSpot Bottom="30" Left="160" NavigateUrl="tsxx.aspx" Right="319" />
<asp:RectangleHotSpot Bottom="30" Left="320" NavigateUrl="yuanxiAdmin.aspx" Right="479" />
<asp:RectangleHotSpot Bottom="30" Left="480" NavigateUrl="banjiAdmin.aspx" Right="639" />
<asp:RectangleHotSpot Bottom="30" Left="640" NavigateUrl="Login.aspx" Right="799" /></asp:ImageMap>
红色部分的字体我是想点击“退出系统”时,跳转到刚开始时候的登录页面Login页面,并且在一个母版MasterPage中用到了该Web用户控件。。
在运行Login登陆页面后我使用某个用户名、密码和身份登录到main_Ok页面,并且mian_OK页面使用了masterPage母版,但是在点击“退出系统”时,总是会跳转到main_OK页面,请问大家这是什么原因呢?
Login页面判断用户身份的代码如下:
protected void Page_Load(object sender, EventArgs e)
{ if (Session["leave"] != null)
{
string leave = Session["leave"].ToString(); if (leave == "1")
{
Response.Redirect("tsxx.aspx");
} else
{
Response.Redirect("main_OK.aspx");
}
}
}
解决方案 »
- 必须声明主体,因为它未标记为 abstract、extern 或 partial
- 怎么控制DataTable移动行?
- asp:TextBox的ClientID为什么和页面生成时的不一样?
- 关于留言板的分页代码
- 各位大侠 求思路
- 如何在類中用Session ?
- 如何把数据库连接代码编译成DLL,然后调用?
- ==问一个cookies的问题,为什么老是提示‘未将对象置入对象’啊
- ****着急,大家快来帮我看看这段代码,是关于调用outlook发信的,谢谢!!
- asp.net中外部控件使用--SOS
- 求助,下载了带后台的码源,导航文字不能改动,改一个字就乱码
- ASAX控件updateprogress里面的button控件不能在后台.CS中响应吗?
在使用Button按钮时可以加上这句话,但是我是用的是Web 用户控件添加的图片,这样该怎样清除回话呢???
{ if (Session["leave"]!=null)
{
Response.Redirect("后台主页.aspx");
}
else
{
Response.Redirect("登陆框页面.aspx");
}
} /// <summary>
/// 退出事件中加入此方法
/// </summary>
protected void LoginOut()
{
Session.Remove("leave");
Response.Redirect("登陆框页面.aspx");
}
如果还是不行再用断点调试程序试试