页面跳转并传递参数
在頁面重新定下url 時傳遞參數,使用 ? 分隔頁面的鏈接地址和參數。有多個參數時用 & 分隔。 例如 Response.Redirect("~/welcome.aspx?name="+TextBox1.Text.ToString()); 這句代碼將text1的內容以字符串的形式傳遞了welcome.aspx頁面。 在Welcome.aspx的代碼頁中再接收來自這個頁面的參數。代碼如下: string name = Request.Params["name"];//這句是關鍵。獲得參數
??????? Response.Write("Welcome " + name + "!");
??????? Response.Write("Welcome " + name + "!");
轉載于:https://blog.51cto.com/tao1848/213687
總結
- 上一篇: 第一次给知名项目贡献代码,有点紧张
- 下一篇: 精品 IDEA 插件大汇总!值得收藏