2017-3-16jquery
mvc+jquery+easyUI作項目ajax
<input type="text" id="txtSTQty" name="txtSTQty" value="0" class="easyui-validatebox textbox" data-options="required:true,validType:'intOrFloat'" style="width:170px;height:22px;" /><span style="color:gray;"> 移交數=良品數+不良品數</span>
//初始化textbox內容 $(function () { $.ajax({ url: "/PdtProductionProcess/GetTranStockQty", data: { IDs: "0" }, type: "POST", dataType: "json", success: function (data) { alert(data.StockQty); $("#txtSTQty").val(data.StockQty); } }); });
public ActionResult GetTranStockQty() { return Content("{\"StockQty\":9999}"); }
測試OKjson