PageTransfer 页面跳转

<asp:Button ID="btnRedirect" runat="server" Text="使用Redirect" OnClick="btnRedirect_Click" />

<asp:Button ID="btnTransfer" runat="server" Text="使用Transfer" OnClick="btnTransfer_Click" />

<asp:Button ID="btnExecute" runat="server" Text="使用Execute" OnClick="btnExecute_Click" />

<asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/Target.aspx">使用LinkButton</asp:LinkButton>

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Target.aspx">使用HyperLink</asp:HyperLink>

<a href="Target.aspx" target="_self">使用超级链接</a>


<input id="Button1" type="button" value="使用window.location" onclick="window.location='Target.aspx'" />

 

protected void btnRedirect_Click(object sender, EventArgs e)
{
Response.Redirect("~/Target.aspx");
}
protected void btnTransfer_Click(object sender, EventArgs e)
{
Server.Transfer("~/Target.aspx");
}
protected void btnExecute_Click(object sender, EventArgs e)
{
Server.Execute("~/Target.aspx");
}

posted @ 2013-01-19 17:22  yellowshorts  阅读(225)  评论(0编辑  收藏  举报