I have a code on a visual web part user control (see below): Could you please advice, how to get value from the callback function back to the C# in code behind to process it?
<script type="text/javascript">
function portal_BaseCallback(result, value) {
if (result === SP.UI.DialogResult.OK) {
// here I need to transfer value to C# code behind to process
}
if (result === SP.UI.DialogResult.cancel) {
//user press Cancel, ignore it
}
}
function GetBaseOptions(m_title, m_url, width, height) {
var options = {
url: m_url,
width: width,
height: height,
title: m_title,
dialogReturnValueCallback: Function.createDelegate(null, portal_BaseCallback)
};
return options;
}
function openDialog(options) {
SP.UI.ModalDialog.showModalDialog(options);
}
</script>
<asp:UpdatePanel runat="server" ID="MyUpdatePanel">
<ContentTemplate>
<asp:LinkButton runat="server" Id="Link01" Text="Write a letter"
OnClientClick="openDialog(GetBaseOptions('Write a message','/_layouts/htmledit.aspx',1024,800));"
onclick="Link01_Click" />
</ContentTemplate>
</asp:UpdatePanel>