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 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 4: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 8: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 4:27 PM
 
It's a very good tools!
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...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


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