首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

!用c#2005中的母版页创建的页面,超链接用不了

2012-01-05 
求助!用c#2005中的母版页创建的页面,超链接用不了?母版HTML:%@ Master LanguageC# AutoEventWireupt

求助!用c#2005中的母版页创建的页面,超链接用不了?
母版HTML:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
   
  <title>无标题页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body {
background-image: url(material/Index/bj.jpg);
background-color: #f4f5f6;
background-repeat: no-repeat;
}
#apDiv1 {
position:absolute;
width:200px;
height:115px;
z-index:1;
left: 1px;
top: 516px;
}
#apDiv2 {
position:absolute;
width:200px;
height:62px;
z-index:1;
top: 553px;
left: 0px;
}
#apDiv3 {
position:absolute;
width:200px;
height:105px;
z-index:1;
left: -2px;
top: 370px;
}
#apDiv4 {
position:absolute;
width:200px;
height:115px;
z-index:1;
}
#apDiv5 {
position:absolute;
width:200px;
height:115px;
z-index:2;
left: 253px;
top: 122px;
}
#apDiv6 {
position:absolute;
width:200px;
height:683px;
z-index:1;
left: 349px;
top: 146px;
}
.d {
background-color: #EEE;
}
-->
</style>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <form id="form1" runat="server">
<div style="text-align: center">
  <br />
  <br />
  <br />
  &nbsp;<table border="0" cellspacing="0" cellpadding="0" style="width: 1108px; height: 286px; left: 0px; border-top-width: thin; border-left-width: thin; border-bottom-width: thin; border-right-width: thin;" >
  <tr>
  <td bgcolor="#1f7325" style="width: 241px; background-color: #f4f5f7;">
  </td>
  <td style="width: 760px; height: 27px; background-color: #f4f5f7; left: 100px; position: static;" colspan="4">&nbsp;<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/material/Index/shouye.jpg" OnClick="ImageButton1_Click" />&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/material/Index/banji.jpg" OnClick="ImageButton2_Click" />&nbsp;<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/material/Index/gerenxinxi.jpg" OnClick="ImageButton3_Click" />&nbsp;<asp:ImageButton ID="ImageButton4" runat="server" ImageUrl="~/material/Index/guanli.jpg" OnClick="ImageButton4_Click" />

  <asp:ImageButton ID="ImageButton5" runat="server" ImageUrl="~/material/Index/liuyanban.jpg" OnClick="ImageButton5_Click" /></td>
  </tr>
  <tr>
  <td style="width: 241px; height: 289px; ">&nbsp;</td>
  <td style="height: 289px; width: 760px; background-color: #ffffff; border-right: thin solid; border-top: thin solid; border-left: thin solid; border-bottom: thin solid;" colspan="4">
  <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">


   
   
  </asp:ContentPlaceHolder>
  </td>
  </tr>
  <tr>
  <td style=" width: 241px; height: 92px; background-color: #f4f5f7">
  </td>
  <td colspan="4" style="width: 760px; height: 92px; background-color: #f4f5f7">
  </td>
  </tr>
  </table>
  &nbsp;<br />

</div>
  </form>
</body>
</html>
母版CS:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
  protected void Page_Load(object sender, EventArgs e)
  {

  }

  protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
  {
  Response.Redirect("Homepage.aspx");
  }
  protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
  {
  Response.Redirect("Class.aspx");
  }
  protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
  {
  Response.Redirect("Update.aspx");
  }
  protected void ImageButton4_Click(object sender, ImageClickEventArgs e)
  {
  Response.Redirect("Manage.aspx");
  }
  protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
  {
  Response.Redirect("Index.aspx");
  }

}

[解决办法]
母版页使用 Response.Redirect是可以的

热点排行