11 个解决方案
#1
把代码贴出来看看?
#2
<%@ Register TagPrefix="cc1" Namespace="WuFeng.Computer" Assembly="UpFile" %>
<%@ Register TagPrefix="uc1" TagName="top" Src="control/top.ascx" %>
<%@ Page language="c#" Codebehind="WarningForm.aspx.cs" AutoEventWireup="false" Inherits="Reservation.WarningForm" %>
<%@ Register TagPrefix="uc1" TagName="down" Src="control/down.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>错误提示</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK media="all" href="../Reservation/Script/Style.CSS" type="text/css" rel="stylesheet">
</HEAD>
<body leftMargin="100" rightMargin="100" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT>
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TBODY>
<TR>
<TD class="title-lv" style="HEIGHT: 14px" width="100"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 500px; HEIGHT: 14px" vAlign="top" align="center" background="file:///C:\Inetpub\wwwroot\Reservation\Images\bg.jpg"><FONT face="宋体"> <asp:linkbutton id="lnkBtnFirstPage" runat="server" CausesValidation="False">首页</asp:linkbutton>
<asp:linkbutton id="lnkBtnReg" runat="server" CausesValidation="False">注册</asp:linkbutton>
<asp:linkbutton id="lnkbtnAbout" runat="server" CausesValidation="False">about</asp:linkbutton>
<asp:linkbutton id="lnkBtnMsg" runat="server" CausesValidation="False">客户反馈</asp:linkbutton></FONT></TD>
<TD class="title-lv" style="HEIGHT: 14px" width="125"><FONT face="宋体"></FONT></TD>
</TR>
<TR>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button1" runat="server" Text="Button" Visible="False" Width="48px" Height="24px"></asp:button></TD>
<TD style="WIDTH: 717px; HEIGHT: 57px" vAlign="top" align="right" background="file:///C:\Inetpub\wwwroot\Reservation\Images\top.jpg"> </FONT>
</TD>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button2" runat="server" Text="Button" Visible="False" Width="48px" Height="23px"></asp:button></TD>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px; HEIGHT: 87px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 719px; HEIGHT: 87px"><asp:label id="lblMessage" runat="server" Width="427px" Height="37px"></asp:label><FONT face="宋体">请
<asp:Label id="Label1" runat="server">
<A href="javascript:history.back(-1)">返回上一页</A></asp:Label>
<asp:LinkButton id="LinkButton1" runat="server" Visible="False">返回</asp:LinkButton>
<asp:Button id="Button3" runat="server" Text="Button" Visible="False"></asp:Button></FONT></TD>
<td class="title-lv"><FONT style="BACKGROUND-COLOR: #ffffff" face="宋体"></FONT><FONT face="宋体"></FONT></td>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 717px" align="center"><uc1:down id="Down1" runat="server"></uc1:down></TD>
<TD class="title-lv"><FONT face="宋体"></FONT></TD>
</TR>
</TBODY>
</TABLE>
</form>
</body>
</HTML>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Reservation
{
/// <summary>
/// WarningForm 的摘要说明。
/// </summary>
public class WarningForm : System.Web.UI.Page
{
protected System.Web.UI.WebControls.LinkButton lnkBtnFirstPage;
protected System.Web.UI.WebControls.LinkButton lnkBtnReg;
protected System.Web.UI.WebControls.LinkButton lnkbtnAbout;
protected System.Web.UI.WebControls.LinkButton lnkBtnMsg;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.Button Button3;
protected System.Web.UI.WebControls.Label lblMessage;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!IsPostBack)
{
if(Request["flag"]=="timeWrong")
{
this.lblMessage.Text="对不起,日期不得小于当前日期!";
}
else if(Request["flag"]=="accomplish")
{
this.lblMessage.Text="预定成功!你的订单号是:"+Request["RegID"];
}
else if(Request["flag"]=="hitChoose")
{
this.lblMessage.Text="对不起,请点选择,以此来选择这个时间段的可用房情!";
}
else if(Request["flag"]=="timeChoose")
{
this.lblMessage.Text="对不起,请选择抵店和离店时间!";
}
else if(Request["flag"]=="noFreeRoom")
{
this.lblMessage.Text="对不起,没有空房可订,请选择其它房间!";
}
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void LinkButton1_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
private void Button3_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
return;
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
}
}
<%@ Register TagPrefix="uc1" TagName="top" Src="control/top.ascx" %>
<%@ Page language="c#" Codebehind="WarningForm.aspx.cs" AutoEventWireup="false" Inherits="Reservation.WarningForm" %>
<%@ Register TagPrefix="uc1" TagName="down" Src="control/down.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>错误提示</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK media="all" href="../Reservation/Script/Style.CSS" type="text/css" rel="stylesheet">
</HEAD>
<body leftMargin="100" rightMargin="100" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT>
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TBODY>
<TR>
<TD class="title-lv" style="HEIGHT: 14px" width="100"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 500px; HEIGHT: 14px" vAlign="top" align="center" background="file:///C:\Inetpub\wwwroot\Reservation\Images\bg.jpg"><FONT face="宋体"> <asp:linkbutton id="lnkBtnFirstPage" runat="server" CausesValidation="False">首页</asp:linkbutton>
<asp:linkbutton id="lnkBtnReg" runat="server" CausesValidation="False">注册</asp:linkbutton>
<asp:linkbutton id="lnkbtnAbout" runat="server" CausesValidation="False">about</asp:linkbutton>
<asp:linkbutton id="lnkBtnMsg" runat="server" CausesValidation="False">客户反馈</asp:linkbutton></FONT></TD>
<TD class="title-lv" style="HEIGHT: 14px" width="125"><FONT face="宋体"></FONT></TD>
</TR>
<TR>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button1" runat="server" Text="Button" Visible="False" Width="48px" Height="24px"></asp:button></TD>
<TD style="WIDTH: 717px; HEIGHT: 57px" vAlign="top" align="right" background="file:///C:\Inetpub\wwwroot\Reservation\Images\top.jpg"> </FONT>
</TD>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button2" runat="server" Text="Button" Visible="False" Width="48px" Height="23px"></asp:button></TD>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px; HEIGHT: 87px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 719px; HEIGHT: 87px"><asp:label id="lblMessage" runat="server" Width="427px" Height="37px"></asp:label><FONT face="宋体">请
<asp:Label id="Label1" runat="server">
<A href="javascript:history.back(-1)">返回上一页</A></asp:Label>
<asp:LinkButton id="LinkButton1" runat="server" Visible="False">返回</asp:LinkButton>
<asp:Button id="Button3" runat="server" Text="Button" Visible="False"></asp:Button></FONT></TD>
<td class="title-lv"><FONT style="BACKGROUND-COLOR: #ffffff" face="宋体"></FONT><FONT face="宋体"></FONT></td>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 717px" align="center"><uc1:down id="Down1" runat="server"></uc1:down></TD>
<TD class="title-lv"><FONT face="宋体"></FONT></TD>
</TR>
</TBODY>
</TABLE>
</form>
</body>
</HTML>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Reservation
{
/// <summary>
/// WarningForm 的摘要说明。
/// </summary>
public class WarningForm : System.Web.UI.Page
{
protected System.Web.UI.WebControls.LinkButton lnkBtnFirstPage;
protected System.Web.UI.WebControls.LinkButton lnkBtnReg;
protected System.Web.UI.WebControls.LinkButton lnkbtnAbout;
protected System.Web.UI.WebControls.LinkButton lnkBtnMsg;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.Button Button3;
protected System.Web.UI.WebControls.Label lblMessage;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!IsPostBack)
{
if(Request["flag"]=="timeWrong")
{
this.lblMessage.Text="对不起,日期不得小于当前日期!";
}
else if(Request["flag"]=="accomplish")
{
this.lblMessage.Text="预定成功!你的订单号是:"+Request["RegID"];
}
else if(Request["flag"]=="hitChoose")
{
this.lblMessage.Text="对不起,请点选择,以此来选择这个时间段的可用房情!";
}
else if(Request["flag"]=="timeChoose")
{
this.lblMessage.Text="对不起,请选择抵店和离店时间!";
}
else if(Request["flag"]=="noFreeRoom")
{
this.lblMessage.Text="对不起,没有空房可订,请选择其它房间!";
}
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void LinkButton1_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
private void Button3_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
return;
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
}
}
#3
LinkButton1会触发服务器回调事件,也就是会刷新页面。
#4
那怎么办啊?
我现在要用这个控件来实现不同的返回页面如何办到啊?
我现在要用这个控件来实现不同的返回页面如何办到啊?
#5
用别的控件拉。。
#6
button也一样。不知道为什么?
高手们,能否看看我的代码。。。。
我试过N次了。
高手们,能否看看我的代码。。。。
我试过N次了。
#7
用HTML控件加脚本代码实现
#8
你用htmlbutton
#9
用JS去实现,
function GoBack()
{
var flag;
flag="F";
if (flag!="F")
{
if (""=="POST")
{
window.frmGoBack.submit();
}
else
{
window.location.href =
}
}
else
{
window.location.href=
}
}
也可以去参考一些购物网站的实现方式
function GoBack()
{
var flag;
flag="F";
if (flag!="F")
{
if (""=="POST")
{
window.frmGoBack.submit();
}
else
{
window.location.href =
}
}
else
{
window.location.href=
}
}
也可以去参考一些购物网站的实现方式
#10
还是不行。
我快死掉了。
上面那个仁兄的方法我使用了,可是我的FLAG是传进来的。
如果不是AA则后退一页,否则转向首页
高手,再帮一下吧。。。
多谢了!!!
我快死掉了。
上面那个仁兄的方法我使用了,可是我的FLAG是传进来的。
如果不是AA则后退一页,否则转向首页
高手,再帮一下吧。。。
多谢了!!!
#11
搞定了
还是两方面加起来才有效,多谢诸位了。
还是两方面加起来才有效,多谢诸位了。
#1
把代码贴出来看看?
#2
<%@ Register TagPrefix="cc1" Namespace="WuFeng.Computer" Assembly="UpFile" %>
<%@ Register TagPrefix="uc1" TagName="top" Src="control/top.ascx" %>
<%@ Page language="c#" Codebehind="WarningForm.aspx.cs" AutoEventWireup="false" Inherits="Reservation.WarningForm" %>
<%@ Register TagPrefix="uc1" TagName="down" Src="control/down.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>错误提示</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK media="all" href="../Reservation/Script/Style.CSS" type="text/css" rel="stylesheet">
</HEAD>
<body leftMargin="100" rightMargin="100" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT>
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TBODY>
<TR>
<TD class="title-lv" style="HEIGHT: 14px" width="100"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 500px; HEIGHT: 14px" vAlign="top" align="center" background="file:///C:\Inetpub\wwwroot\Reservation\Images\bg.jpg"><FONT face="宋体"> <asp:linkbutton id="lnkBtnFirstPage" runat="server" CausesValidation="False">首页</asp:linkbutton>
<asp:linkbutton id="lnkBtnReg" runat="server" CausesValidation="False">注册</asp:linkbutton>
<asp:linkbutton id="lnkbtnAbout" runat="server" CausesValidation="False">about</asp:linkbutton>
<asp:linkbutton id="lnkBtnMsg" runat="server" CausesValidation="False">客户反馈</asp:linkbutton></FONT></TD>
<TD class="title-lv" style="HEIGHT: 14px" width="125"><FONT face="宋体"></FONT></TD>
</TR>
<TR>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button1" runat="server" Text="Button" Visible="False" Width="48px" Height="24px"></asp:button></TD>
<TD style="WIDTH: 717px; HEIGHT: 57px" vAlign="top" align="right" background="file:///C:\Inetpub\wwwroot\Reservation\Images\top.jpg"> </FONT>
</TD>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button2" runat="server" Text="Button" Visible="False" Width="48px" Height="23px"></asp:button></TD>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px; HEIGHT: 87px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 719px; HEIGHT: 87px"><asp:label id="lblMessage" runat="server" Width="427px" Height="37px"></asp:label><FONT face="宋体">请
<asp:Label id="Label1" runat="server">
<A href="javascript:history.back(-1)">返回上一页</A></asp:Label>
<asp:LinkButton id="LinkButton1" runat="server" Visible="False">返回</asp:LinkButton>
<asp:Button id="Button3" runat="server" Text="Button" Visible="False"></asp:Button></FONT></TD>
<td class="title-lv"><FONT style="BACKGROUND-COLOR: #ffffff" face="宋体"></FONT><FONT face="宋体"></FONT></td>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 717px" align="center"><uc1:down id="Down1" runat="server"></uc1:down></TD>
<TD class="title-lv"><FONT face="宋体"></FONT></TD>
</TR>
</TBODY>
</TABLE>
</form>
</body>
</HTML>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Reservation
{
/// <summary>
/// WarningForm 的摘要说明。
/// </summary>
public class WarningForm : System.Web.UI.Page
{
protected System.Web.UI.WebControls.LinkButton lnkBtnFirstPage;
protected System.Web.UI.WebControls.LinkButton lnkBtnReg;
protected System.Web.UI.WebControls.LinkButton lnkbtnAbout;
protected System.Web.UI.WebControls.LinkButton lnkBtnMsg;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.Button Button3;
protected System.Web.UI.WebControls.Label lblMessage;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!IsPostBack)
{
if(Request["flag"]=="timeWrong")
{
this.lblMessage.Text="对不起,日期不得小于当前日期!";
}
else if(Request["flag"]=="accomplish")
{
this.lblMessage.Text="预定成功!你的订单号是:"+Request["RegID"];
}
else if(Request["flag"]=="hitChoose")
{
this.lblMessage.Text="对不起,请点选择,以此来选择这个时间段的可用房情!";
}
else if(Request["flag"]=="timeChoose")
{
this.lblMessage.Text="对不起,请选择抵店和离店时间!";
}
else if(Request["flag"]=="noFreeRoom")
{
this.lblMessage.Text="对不起,没有空房可订,请选择其它房间!";
}
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void LinkButton1_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
private void Button3_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
return;
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
}
}
<%@ Register TagPrefix="uc1" TagName="top" Src="control/top.ascx" %>
<%@ Page language="c#" Codebehind="WarningForm.aspx.cs" AutoEventWireup="false" Inherits="Reservation.WarningForm" %>
<%@ Register TagPrefix="uc1" TagName="down" Src="control/down.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>错误提示</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK media="all" href="../Reservation/Script/Style.CSS" type="text/css" rel="stylesheet">
</HEAD>
<body leftMargin="100" rightMargin="100" MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT>
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TBODY>
<TR>
<TD class="title-lv" style="HEIGHT: 14px" width="100"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 500px; HEIGHT: 14px" vAlign="top" align="center" background="file:///C:\Inetpub\wwwroot\Reservation\Images\bg.jpg"><FONT face="宋体"> <asp:linkbutton id="lnkBtnFirstPage" runat="server" CausesValidation="False">首页</asp:linkbutton>
<asp:linkbutton id="lnkBtnReg" runat="server" CausesValidation="False">注册</asp:linkbutton>
<asp:linkbutton id="lnkbtnAbout" runat="server" CausesValidation="False">about</asp:linkbutton>
<asp:linkbutton id="lnkBtnMsg" runat="server" CausesValidation="False">客户反馈</asp:linkbutton></FONT></TD>
<TD class="title-lv" style="HEIGHT: 14px" width="125"><FONT face="宋体"></FONT></TD>
</TR>
<TR>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button1" runat="server" Text="Button" Visible="False" Width="48px" Height="24px"></asp:button></TD>
<TD style="WIDTH: 717px; HEIGHT: 57px" vAlign="top" align="right" background="file:///C:\Inetpub\wwwroot\Reservation\Images\top.jpg"> </FONT>
</TD>
<TD class="title-lv" style="HEIGHT: 57px" width="100"><asp:button id="Button2" runat="server" Text="Button" Visible="False" Width="48px" Height="23px"></asp:button></TD>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px; HEIGHT: 87px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 719px; HEIGHT: 87px"><asp:label id="lblMessage" runat="server" Width="427px" Height="37px"></asp:label><FONT face="宋体">请
<asp:Label id="Label1" runat="server">
<A href="javascript:history.back(-1)">返回上一页</A></asp:Label>
<asp:LinkButton id="LinkButton1" runat="server" Visible="False">返回</asp:LinkButton>
<asp:Button id="Button3" runat="server" Text="Button" Visible="False"></asp:Button></FONT></TD>
<td class="title-lv"><FONT style="BACKGROUND-COLOR: #ffffff" face="宋体"></FONT><FONT face="宋体"></FONT></td>
</TR>
<TR>
<TD class="title-lv" style="WIDTH: 76px"><FONT face="宋体"></FONT></TD>
<TD style="WIDTH: 717px" align="center"><uc1:down id="Down1" runat="server"></uc1:down></TD>
<TD class="title-lv"><FONT face="宋体"></FONT></TD>
</TR>
</TBODY>
</TABLE>
</form>
</body>
</HTML>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Reservation
{
/// <summary>
/// WarningForm 的摘要说明。
/// </summary>
public class WarningForm : System.Web.UI.Page
{
protected System.Web.UI.WebControls.LinkButton lnkBtnFirstPage;
protected System.Web.UI.WebControls.LinkButton lnkBtnReg;
protected System.Web.UI.WebControls.LinkButton lnkbtnAbout;
protected System.Web.UI.WebControls.LinkButton lnkBtnMsg;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.Button Button3;
protected System.Web.UI.WebControls.Label lblMessage;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!IsPostBack)
{
if(Request["flag"]=="timeWrong")
{
this.lblMessage.Text="对不起,日期不得小于当前日期!";
}
else if(Request["flag"]=="accomplish")
{
this.lblMessage.Text="预定成功!你的订单号是:"+Request["RegID"];
}
else if(Request["flag"]=="hitChoose")
{
this.lblMessage.Text="对不起,请点选择,以此来选择这个时间段的可用房情!";
}
else if(Request["flag"]=="timeChoose")
{
this.lblMessage.Text="对不起,请选择抵店和离店时间!";
}
else if(Request["flag"]=="noFreeRoom")
{
this.lblMessage.Text="对不起,没有空房可订,请选择其它房间!";
}
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void LinkButton1_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
private void Button3_Click(object sender, System.EventArgs e)
{
if(Request["flag"]!="accomplish")
{
Response.Write("<script language=javascript>history.back(-1);</script>");
return;
}
else
{
Response.Write("<script language=javascript>window.location.href='MainResv.aspx';</script>");
}
}
}
}
#3
LinkButton1会触发服务器回调事件,也就是会刷新页面。
#4
那怎么办啊?
我现在要用这个控件来实现不同的返回页面如何办到啊?
我现在要用这个控件来实现不同的返回页面如何办到啊?
#5
用别的控件拉。。
#6
button也一样。不知道为什么?
高手们,能否看看我的代码。。。。
我试过N次了。
高手们,能否看看我的代码。。。。
我试过N次了。
#7
用HTML控件加脚本代码实现
#8
你用htmlbutton
#9
用JS去实现,
function GoBack()
{
var flag;
flag="F";
if (flag!="F")
{
if (""=="POST")
{
window.frmGoBack.submit();
}
else
{
window.location.href =
}
}
else
{
window.location.href=
}
}
也可以去参考一些购物网站的实现方式
function GoBack()
{
var flag;
flag="F";
if (flag!="F")
{
if (""=="POST")
{
window.frmGoBack.submit();
}
else
{
window.location.href =
}
}
else
{
window.location.href=
}
}
也可以去参考一些购物网站的实现方式
#10
还是不行。
我快死掉了。
上面那个仁兄的方法我使用了,可是我的FLAG是传进来的。
如果不是AA则后退一页,否则转向首页
高手,再帮一下吧。。。
多谢了!!!
我快死掉了。
上面那个仁兄的方法我使用了,可是我的FLAG是传进来的。
如果不是AA则后退一页,否则转向首页
高手,再帮一下吧。。。
多谢了!!!
#11
搞定了
还是两方面加起来才有效,多谢诸位了。
还是两方面加起来才有效,多谢诸位了。