我有一個javascript函數和c#fanction。我需要從javascript函數調用c#函數,但我不知道如何...從javascript函數調用c#函數
有人可以幫助我嗎?
謝謝!
JavaScript的功能 -
<script type="text/javascript" language="javascript">
function DeleteBook(idimg) {
// idimg is a string
var userConfirm = window.confirm('Are you sure?');
if (userConfirm == true) {
control.Sess(idimg);// The line which is colling to the c# function - doesn't work
window.open('Delete.aspx');
}
else
return false;
}
</script>
C#的功能 -
protected void Sess(string id)
{
Session["forDelete"] = id;
}
你可以暴露你想在一個WCF服務調用的方法,並通過AJAX打他們。 – NWard
我不知道該怎麼做... – user3526787
WCF服務是什麼? – user3526787