sure - at its simplest create a new module
add
Imports
DotNetNuke.UI.Utilities
and implement the call back handler
Implements IClientAPICallbackEventHandler
and make sure you reference dotnetnuke.webutility
in the design add an image (not a server control but a regular image and put runat=server on it)
in the page load add this
If
ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XMLHTTP) AndAlso ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XML) Then
ClientAPI.RegisterClientReference(
Me.Page, ClientAPI.ClientNamespaceReferences.dnn)
ClientAPI.RegisterClientReference(
Me.Page, ClientAPI.ClientNamespaceReferences.dnn_xml)
ClientAPI.RegisterClientReference(
Me.Page, ClientAPI.ClientNamespaceReferences.dnn_xmlhttp)
End If
ClientAPI.RegisterClientVariable(
Me.Page, "ListNumber", "15", False)
ClientAPI.RegisterClientVariable(
Me.Page, "LoggedOutRedirect", NavigateURL, False)
Dim MyVariable As System.Web.UI.Control = Me.Page.FindControl(ClientAPI.DNNVARIABLE_CONTROLID)
Me.lbImg.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(Me, "'subscribe'", "successFunc", Me.lbImg.ClientID.ToString, "errorFunc", MyVariable))
(replace me.lbimg with your own control name)
in the html view of the design add
<script language="javascript">
<!--
function successFunc(result,ctx)
{
alert (result);
}
function errorFunc(result,ctx)
{
alert ('failure' + result);
}
//-->
</script>
thien back in the code behind
Public Function RaiseClientAPICallbackEvent(ByVal eventArgument As String) As String Implements DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler.RaiseClientAPICallbackEvent
RETURN "Somestring"
End Function
after that build the module and set it up in a portal - now you will see it works in IE and if you open the Javascript console in Firefox that you have problems -
Is that clear as mud??????????