All -- I have been trying to find a working example of passing data from a Dojo function to an ASP.Net code behind. THe only post I found that at least offers an easy example is this POST
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Hidden inputs are how I do it for simple pages.
ASP.Net Markup (simplified):
function saveMyData() {
var myData = resultOfSomeOtherFunction();
var hiddenInput = document.getElementById('<%=HiddenField1.ClientID %>');
hiddenInput.value = myData;
}
<asp:HiddenField ID="HiddenField1" runat="server" />
Code-Behind:
value = HiddenField1.Value;
When I want to get fancy, I'll post it to an API I write via an AJAX call.