ASP.net實現(xiàn)頁面跳轉(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)然我們可以在頁面跳轉(zhuǎ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);
}
上面是我的一個項目中的代碼所以有item,大家可以根據(jù)自己的情況進行設(shè)定。
那么既然傳遞了參數(shù),在跳轉(zhuǎn)的頁面怎樣獲取呢???
代碼如下:
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)建實時聊天應(yīng)用程序
- Asp.NET MVC中使用SignalR實現(xiàn)推送功能
- asp.net mvc signalr簡單聊天室制作過程分析
- Asp.net使用SignalR實現(xiàn)消息提醒
- Asp.net SignalR支持的平臺有哪些
- Asp.net使用SignalR實現(xiàn)發(fā)送圖片
- 三種asp.net頁面跳轉(zhuǎn)的方法
- ASP.NET筆記之頁面跳轉(zhuǎn)、調(diào)試、form表單、viewstate、cookie的使用說明
- 新發(fā)現(xiàn)原來documenet.URL也可以實現(xiàn)頁面跳轉(zhuǎn)
- SignalR發(fā)送頁面跳轉(zhuǎn)通知的方法
相關(guān)文章
一步步打造簡單的MVC電商網(wǎng)站BooksStore(4)
這篇文章主要和大家一起一步步打造一個簡單的MVC電商網(wǎng)站,MVC電商網(wǎng)站BooksStore第四篇,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04
C#數(shù)據(jù)綁定控件中的DataSource屬性淺談
使用該屬性指定用來填充Repeater控件的數(shù)據(jù)源。DataSource可以是任何System.Collections.IEnumerable對象, 如用于訪問數(shù)據(jù)庫的System.Data.DataView、System.Collections.ArrayList、System.Collections.Hashtable、數(shù)組或IListSource對象2013-02-02
.Net Core中使用ref和Span<T>提高程序性能的實現(xiàn)代碼
這篇文章主要介紹了.Net Core中使用ref和Span<T>提高程序性能的簡單實現(xiàn)代碼,需要的朋友可以參考下2017-05-05
ASP.NET2.0緩存(Cache)技術(shù)深入理解
緩存技術(shù)是ASP.NET2.0非常重要的一個特性,它提供了一種非常好的本地數(shù)據(jù)緩存機制,從而有效的提高數(shù)據(jù)訪問的性能2012-11-11
Visual Studio 2017創(chuàng)建.net standard類庫編譯出錯原因及解決方法
這篇文章主要為大家詳細介紹了Visual Studio 2017創(chuàng)建.net standard類庫編譯出錯原因及解決方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04

