Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIneed help with client callback apineed help with client callback api
Previous
 
Next
New Post
8/17/2006 3:22 AM
 
Hi,
I'm trying to make a very simple module in which on pressing a button there should appear an alert in c#. But My code isn't working , when I press the button , nothing happens..no erros here is the code pls help me with it.

========================================
using DotNetNuke;
using DotNetNuke.UI.Utilities;
namespace TestModule
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;

    public class Content:DotNetNuke.Entities.Modules.PortalModuleBase,
       DotNetNuke.Entities.Modules.IActionable,
       DotNetNuke.Entities.Modules.IPortable,
       DotNetNuke.Entities.Modules.ISearchable,
        DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler
    {
        protected System.Web.UI.HtmlControls.HtmlInputButton AlertButton;

        private void Page_Load(object sender, System.EventArgs e)
        {
            if(ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XMLHTTP) && ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XML))
            {
                ClientAPI.RegisterClientReference(this.Page,ClientAPI.ClientNamespaceReferences.dnn_xml);
                ClientAPI.RegisterClientReference(this.Page,ClientAPI.ClientNamespaceReferences.dnn_xmlhttp);
            }

                this.AlertButton.Attributes.Add("onclick",ClientAPI.GetCallbackEventReference(this, "test","successFunc", "this", "errorFunc"));


                if(this.Page.IsClientScriptBlockRegistered("helloajax.js") == false)
                {
                    this.Page.RegisterClientScriptBlock("helloajax.js",
                        "<script language=\"javascript\" src="+"\""+this.ModulePath+"helloajax.js"+"\"></script>");
                   
                }
   
        }
       

        public string RaiseClientAPICallbackEvent(string eventArgument)
        {
            return "HELLO: "+eventArgument;
        }

    #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {  
            InitializeComponent();
            ClientAPI.HandleClientAPICallbackEvent(this.Page);
            base.OnInit(e);
           
        }
#endregion

...and some more functions from other interfaces which are implemented.

}


Many Thanks in Advance !
 
New Post
8/17/2006 9:28 AM
 

The code you provided does not show the script you have for the successFunc funciton.

Does the HelloAJAX sample work for you?  I suggest getting that to work and tweaking from there.


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIneed help with client callback apineed help with client callback api


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out