1.对象转换
对象一
var PList1 = from ph in db.Pa_Point_History
join cou in db.Pa_Online_Course
on ph.source_id equals cou.id
where ph.point_source == 4 && ph.user_id == uId && cou.status == 0
select new Pa_Online_CourseModel
{
point = ph.point,
id = ph.id
};
var ol = (List<Pa_Online_CourseModel>)PList1;
对象二
var banks = this.DataProvider.ExecuteObject(typeof(BankInfo), sql, null);
bankInfo = (BankInfo)banks;
2.后台对象赋值,前台读取
例子一
public ExamInfo examInfo { get; set; }
ExamInfo eInfo = new ExamInfo();
eInfo.NewStatus = "未开始"; eInfo.NewResult = "?";
<p>是否完成:<span><%=examInfo.NewStatus%></span></p>
例子二
private string id;
public string Id
{ get { return Request.QueryString["id"]; }
set { id = value; } }
<input type="hidden" id="_id" name="_id" value=‘<%=Id%>‘>
3.input 按钮点击事件
$("input:radio").click(function () {
var domName = $(this).attr(‘name‘);
$("input:radio[name=‘" + domName + "‘]").attr(‘checked‘, false);//1.
$(this).attr(‘checked‘, true);//2.
});
</script>