4中页面跳转的方法

1超链接

2Response.Redirect("UrlString")

重定向

服务器给浏览器的一个重定向指令

过程:浏览器操作--服务器编译--返回页面--浏览器按新URL发出请求--服务器回响应新的URL--编译新页面--返回浏览器

3Server.Transfer("UrlString")

服务器重定向

在服务器发生而不通知浏览器

4PostBackUrl

页面静态超链接:

<a href=http://baidu.com>百度</a>

WEB控件,动态添加

HyperLink hl=new HyperLink();

hl.NavigateUrl="http://baidu.com";

hl.Text="百度";

PanleControl.Controls.Add(hl);

实例

Response.Redirect和Server.Transfer比较:

原文地址:https://www.cnblogs.com/914556495wxkj/p/3716130.html