且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我怎样才能将所选项目设置为会话MVC(剃刀)?

更新时间:2022-05-06 16:14:23

(#btnSelect)。点击(

函数()

{

var value = document.getElementById(CompanyId )。值;

@ Context.Session [CompanyId] ='+ value +';

alert(Session+ @ Context.Session [CompanyId] .ToString());

}

);

< / script>

}





但这会将表达式作为会话点返回给NUll
("#btnSelect").click(
function ()
{
var value = document.getElementById("CompanyId").value;
@Context.Session["CompanyId"]="'"+value+"'";
alert( "Session "+ @Context.Session["CompanyId"].ToString());
}
);
</script>
}


but this returns expression being session points to NUll