.aspx.cs传值与取值

时间:2023-01-21 14:26:08

1:.aspx中post传值

$.post("ABP_ExchangeRatelz.aspx", { option: "isdelete", Ori_Currency: Ori_Currency, Year_Month: Year_Month, Region: Region, time: new Date().getMilliseconds() },

.aspx.cs中post取值(通过Request.Form["参数名称"].ToString()来取值)

string Year_Month = Request.Form["Year_Month"].ToString();

2: .aspx中url传值

location.href = "ABP_ExchangeRatelz_Edit.aspx?op=edit&Region=" + Region + "&Ori_Currency=" + Ori_Currency + "&Year_Month=" + Year_Month;

.aspx.cs中url取值(通过Request.QueryString["参数名称"])

string Year_Month = Request.QueryString["Year_Month"];

3:.aspx中传值到WebService

提交方法"get"

提交地址url: '/Webservice/Monthly_Basic_Data/MBD_ABP_Monthly_basislz.asmx/ABP_Monthly_basislz_List'

WebService中取值

var queryString = this.Context.Request.QueryString;
                var pagenum = int.Parse(queryString.GetValues("pagenum")[0]);