0
<script type="text/javascript">
$(document).ready(function() {
$('#loadbtn').click(function() { // can 't load
opts = {
title: 'ABCD',
series: [{
neighborThreshold: 0
}],
axes: {
xaxis: {
//smethg
},
yaxis: {
//smethg
}
},
};
PageMethods.LoadAsset(LoadSucc, LoadFail); //Want to load by button click event
function LoadSucc(obj) {
goog = obj;
//Something
alert("Data loaded");
}
function LoadFail() {
alert("Data missing");
}
});
});
</script>
加載Pagemethods在我的C#代碼通過點擊按鈕在jQuery的
[System.Web.Services.WebMethod]
public static Array LoadAssetAssignView()
{
//something
return something;
}
ASP:
<asp:Button runat="server" ID="loadbtn" Text="Load" />
其實功能開始在文件準備工作的功能。我想在點擊按鈕時加載該功能。我該怎麼做呢?