ASP.net實(shí)現(xiàn)頁(yè)面跳轉(zhuǎn)的方法
主要是使用response的屬性,代碼如下:
protected void LinkButton1_Click(object sender, EventArgs e)
{
string url = "InfoShow.aspx";
Response.Redirect(url);
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
string url = "InfoShow.aspx";
Response.Redirect(url);
}//當(dāng)然我們可以在頁(yè)面跳轉(zhuǎn)的時(shí)候進(jìn)行參數(shù)傳遞,代碼如下:
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
string url, s;
s = e.Item.Value.ToString();
url = "InfoRelease.aspx?UserName=" + s.Trim();
Response.Redirect(url);
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
string url, s;
s = e.Item.Value.ToString();
url = "InfoRelease.aspx?UserName=" + s.Trim();
Response.Redirect(url);
}
上面是我的一個(gè)項(xiàng)目中的代碼所以有item,大家可以根據(jù)自己的情況進(jìn)行設(shè)定。
那么既然傳遞了參數(shù),在跳轉(zhuǎn)的頁(yè)面怎樣獲取呢???
代碼如下:
protected void Page_Load(object sender, EventArgs e)
{
if (Request["UserName"] != null)
{
string s = Request["UserName"].ToString();
// form1.Visible = true;
txtInfoclass.Text = s;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (Request["UserName"] != null)
{
string s = Request["UserName"].ToString();
// form1.Visible = true;
txtInfoclass.Text = s;
}
}
protected void Page_Load(object sender, EventArgs e)
{
txtAlert.Text = "";
if (Request["UserName"] != null)
{
string s = Request["UserName"].ToString();
// form1.Visible = true;
txtInfoclass.Text = s;
}
}
protected void Page_Load(object sender, EventArgs e)
{
txtAlert.Text = "";
if (Request["UserName"] != null)
{
string s = Request["UserName"].ToString();
// form1.Visible = true;
txtInfoclass.Text = s;
}
}
- Asp.net SignalR創(chuàng)建實(shí)時(shí)聊天應(yīng)用程序
- Asp.NET MVC中使用SignalR實(shí)現(xiàn)推送功能
- asp.net mvc signalr簡(jiǎn)單聊天室制作過(guò)程分析
- Asp.net使用SignalR實(shí)現(xiàn)消息提醒
- Asp.net SignalR支持的平臺(tái)有哪些
- Asp.net使用SignalR實(shí)現(xiàn)發(fā)送圖片
- 三種asp.net頁(yè)面跳轉(zhuǎn)的方法
- ASP.NET筆記之頁(yè)面跳轉(zhuǎn)、調(diào)試、form表單、viewstate、cookie的使用說(shuō)明
- 新發(fā)現(xiàn)原來(lái)documenet.URL也可以實(shí)現(xiàn)頁(yè)面跳轉(zhuǎn)
- SignalR發(fā)送頁(yè)面跳轉(zhuǎn)通知的方法
相關(guān)文章
一步步打造簡(jiǎn)單的MVC電商網(wǎng)站BooksStore(4)
這篇文章主要和大家一起一步步打造一個(gè)簡(jiǎn)單的MVC電商網(wǎng)站,MVC電商網(wǎng)站BooksStore第四篇,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-04-04
C#數(shù)據(jù)綁定控件中的DataSource屬性淺談
使用該屬性指定用來(lái)填充Repeater控件的數(shù)據(jù)源。DataSource可以是任何System.Collections.IEnumerable對(duì)象, 如用于訪問(wèn)數(shù)據(jù)庫(kù)的System.Data.DataView、System.Collections.ArrayList、System.Collections.Hashtable、數(shù)組或IListSource對(duì)象2013-02-02
.Net Core中使用ref和Span<T>提高程序性能的實(shí)現(xiàn)代碼
這篇文章主要介紹了.Net Core中使用ref和Span<T>提高程序性能的簡(jiǎn)單實(shí)現(xiàn)代碼,需要的朋友可以參考下2017-05-05
ASP.NET2.0緩存(Cache)技術(shù)深入理解
緩存技術(shù)是ASP.NET2.0非常重要的一個(gè)特性,它提供了一種非常好的本地?cái)?shù)據(jù)緩存機(jī)制,從而有效的提高數(shù)據(jù)訪問(wèn)的性能2012-11-11
Asp.net使用SignalR實(shí)現(xiàn)消息提醒
這篇文章主要為大家詳細(xì)介紹了Asp.net使用SignalR實(shí)現(xiàn)消息提醒的相關(guān)資料,需要的朋友可以參考下2016-04-04
asp.net(C#)跨域及跨域?qū)慍ookie問(wèn)題
在網(wǎng)站www.A.com下通過(guò)iframe或ajax調(diào)用www.B.com下的內(nèi)容時(shí),默認(rèn)情況下IE會(huì)阻止www.B.com寫任何Cookie2011-10-10
Visual Studio 2017創(chuàng)建.net standard類庫(kù)編譯出錯(cuò)原因及解決方法
這篇文章主要為大家詳細(xì)介紹了Visual Studio 2017創(chuàng)建.net standard類庫(kù)編譯出錯(cuò)原因及解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-04-04

