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