前台代码
--调用后台的GetEcharts1方法,并传入三个参数
startDateValue,ipEndDate,ddlTypeValue
<input type="button" id="loadExce2l" value="查看" onclick="loadEcharts()" />
function loadEcharts() {
console.log(19999999999)
var startDateValue = document.getElementById("ipStartDate").value;
var ipEndDate = document.getElementById("ipEndDate").value
var ddlTypeValue = document.getElementById('ddlType').value;
$.ajax({ url: "frmCIMES_IQCWeeklyAndMonthlyReports.aspx/GetEcharts1", type: "POST", contentType: "application/json; charset=utf-8", dataType: "json", data: JSON.stringify({ startDateValue: startDateValue, ipEndDate: ipEndDate, ddlTypeValue: ddlTypeValue }), success: function (response) { console.log(17777777772222222) var lists = response.d; }, error: function (err) { console.log(1666666666666) console.log(err) alert(err); } }); }
后台代码
[WebMethod(EnableSession = true)] public static List<List<object>> GetEcharts1(string startDateValue, string ipEndDate, string ddlTypeValue) { string strStartDate = startDateValue.Trim(); string strEndDate = ipEndDate.Trim(); string strTypeValue = ddlTypeValue; string jsonData = string.Empty; }
标签:console,string,C#,ipEndDate,ddlTypeValue,aspx,startDateValue,页面 From: https://www.cnblogs.com/kelenote/p/18203224