我有如下定義的模型:從JavaScript值分配模型的屬性值
namespace ESimSolChemical.Models
{
public class Employee
{
public int EmployeeID{ get; set; }
public string EmployeeName{ get; set; }
public string Age{ get; set; }
public string Address{ get; set; }
}
我有以下的JavaScript:
<script type="text/javascript">
$(function() {
$('#btnEmployeePiker').click(function() {
var oParameter = new Object();
oParameter.MultipleReturn = false;
var oReturnObject = window.showModalDialog('/Employee/EmployeePiker/', oParameter, 'dialogHeight:470px;dialogWidth:550px;dialogLeft:400;dialogTop:100;center:yes;resizable:no;status:no;scroll:no');
});
});
</script>
我的JavaScript oReturnObject
包含兩個屬性一樣:
oReturnObject.EmployeeID;
oReturnObject.EmployeeName;
現在我想指定:
@Model.employeeID= oReturnObject.EmployeeID;
我該如何完成此任務?
這是邪惡的... – Yasser 2012-08-08 06:25:33