HomeHomeDotNetNuke Forg...DotNetNuke Forg...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIAbout My C# callback(ajax) in dotnetnuke 4.3 prolemAbout My C# callback(ajax) in dotnetnuke 4.3 prolem
Previous
 
Next
New Post
8/22/2006 1:50 AM
 
 

I do a sample hellowajax using c#. It's working fine if i login as admin or host.

But it's don's work if i am not login.

Don't know why?

But the VB hellowajax sample works fine.

The only different is

When user login the label ID is:        dnn_ctr378_Viewtest_testLBL

But not login the label ID is:             dnn_ctr378_Viewtest__ctl0_testLBL

Will that make any different?

Any idea?

Many Thanks!

 

Here is my Code

protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (((string)Settings["template"] != null) && ((string)Settings["template"] != ""))
                        strTemplate = (string)Settings["template"];
                    else
                        strTemplate = Localization.GetString("Template.Text", LocalResourceFile);

                    testController objtests = new testController();

                    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.Button1.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(this, "dnn.dom.getById('" + testLBL.ClientID + "').value", "successFunc", "'" + Button1.ClientID + "'", "errorFunc"));

                    if (this.Page.IsClientScriptBlockRegistered("helloajax.js") == false)                      
                        this.Page.RegisterClientScriptBlock("ajax.js",
                            "<script language=\"javascript\" src=" + "\"" + this.ModulePath + "ajax.js" + "\"></script>");
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }

        }

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

 

 

<%@ Control language="C#" Inherits="YourCompany.Modules.test.Viewtest" CodeFile="Viewtest.ascx.cs" AutoEventWireup="true"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<asp:Label ID="testLBL" runat="server" Text="This is a Test Label"></asp:Label>
<br>
<input id="Button1" type="button" value="button" name="Button1" runat="server"/><br>

 
New Post
11/2/2006 5:46 PM
 
Try using Anthem ajax library www.anthemdotnet.com. I use it and it is great and easy to use
 
New Post
11/19/2006 12:27 PM
 
It's a very good tools!
 
Previous
 
Next
HomeHomeDotNetNuke Forg...DotNetNuke Forg...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIAbout My C# callback(ajax) in dotnetnuke 4.3 prolemAbout My C# callback(ajax) in dotnetnuke 4.3 prolem


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me
DotNetNuke Store

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Telerik JustCode Free
DotNetNuke DNN Hosting
Exact Target Exec Alert

DotNetNuke Scoop!

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.