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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0About C# callback(ajax) in dotnetnuke 4.3About C# callback(ajax) in dotnetnuke 4.3
Previous
 
Next
New Post
8/20/2006 6:09 PM
 

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.

Any idea?

Many Thanks!

 
New Post
8/21/2006 4:46 PM
 

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
8/21/2006 4:55 PM
 

The only different is

When user login the label ID is:        dnn_ctr378_Viewtest_testLBL

But not login the label IS become to:dnn_ctr378_Viewtest__ctl0_testLBL

Will that make any different?

 
New Post
8/22/2006 5:13 AM
 
It's ok now. Thanks!
 
New Post
8/24/2006 5:22 PM
 
szmulder wrote
It's ok now. Thanks!


Could you explain the solution you have found, because I am facing similar problems
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0About C# callback(ajax) in dotnetnuke 4.3About C# callback(ajax) in dotnetnuke 4.3


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