js与Controller中分割字符串的方法
电脑版发表于:2018/11/22 10:34
js:
var str = OpenRule; var strs = new Array(); strs = str.split(","); for (var i = 0; i < strs.length ; i++) { $("#txtOpenRule1").val(strs[0]); $("#txtOpenRule2").val(strs[1]); $("#txtOpenRule3").val(strs[2]); }
Controller:
string datas = Request["datas"]; string[] str = datas.Split(','); var TemID = str[0]; var AdrCode = str[1]; var Name = str[2];