我想知道如何通過在 Visual Studio (asp.net) 中單擊按鈕來更改“視圖”?
我有 2 個.aspx檔案,一個名為Default.aspx,另一個名為Library.aspx. 如何使按鈕更改視圖以顯示其他 aspx 檔案?
我試過谷歌搜索,但沒有發現任何有用的東西。任何幫助在這里表示贊賞。謝謝
uj5u.com熱心網友回復:
好的,假設 default.aspx 處于設計模式,那么只需從工具箱中拖放一個按鈕到網頁上。
說,像這樣:

現在,雙擊按鈕,我們跳轉到后面的代碼。
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Library.aspx");
}
所以,我們把供代碼跳轉到網頁Library.aspx
我們得到這個:

現在,當我單擊該按鈕時,我會跳轉到名為 Library.aspx 的網頁——我們應該會看到這個(假設網頁 Library.aspx 存在)。

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/474281.html
