日期:2014-05-17 浏览次数:20397 次
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> function submitFormData() { document.forms[0].submit(); } $(document).ready(function () { GetByJquery(); $("#UserInfo").change(function () { GetRelationShip() }); }); function GetByJquery() { $("#UserInfo").add("--选择--"); var a = Math.random(); var url = "/ExpectedScore/GetUserList/" + "?rand=" + a; $.getJSON(url, function (data) { $.each(data, function (i, item) { $("<option></option>") .val(item["UserId"]) .text(item["UserName"]) }); GetRelationShip(); }); } function GetRelationShip() { $("#RelationShip").empty(); var a = Math.random(); var url = "/ExpectedScore/GetRelationShip/" + $("#UserInfo").val() + "/" + "?rand=" + a; $.getJSON(url, function (data) { $.each(data, function (i, item) { $("<option></option>") .val(item["CustomerId"]) .text(item["CustomerName"]) .appendTo($("#RelationShip")); }); }); } </script>
#region 界面还原 ViewBag.OrderState = orderstate; ViewData["Product"] = ProductModels.GetCompanyProduct(UserInfo.CompanyID,0,1); ViewBag.datebegin = datebegin; ViewBag.dateend = dateend; ViewBag.disti_name = disti_name; ViewBag.orderSN = orderSN; ViewBag.click_state = click_state; #endregion
------解决方案--------------------
用dropdownlist中的数据作为查询条件返回后,把dropdownlist中的数据再返回回来不就行了。每次页面刷新的时候,再把这个dropdownlist中的数据用QueryString传回来不行吗?