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 ForumsClientAPIClientAPISimple example problemSimple example problem
Previous
 
Next
New Post
2/2/2007 6:54 AM
 
Hello,

since hours I try this simple thing. I have read all documents and all examples - maybe I am to new to dnn and controls....

There are two LabelEdit-Controls. The first without toolbar, the second with toolbar. I just want to "save" the text of the LabelEdit to the "application".
Please tell me what I am doing wrong!


Here is my Code
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SimpleLabelEdit.ascx.cs"
    Inherits="SimpleLabelEdit" %>
<%@ Register Assembly="DotNetNuke.WebControls" Namespace="DotNetNuke.UI.WebControls"
    TagPrefix="DNN" %>
<DNN:DNNLabelEdit ID="DNNLabelEdit1" runat="server"></DNN:DNNLabelEdit>
<br />
<br />
<DNN:DNNLabelEdit ID="UserProfileWittyOneLinerEditLabel" runat="server" ToolBarId="UserProfileWittyOneLinerToolbar"
    CssClass="label" LabelEditCssClass="labeledit" WorkCssClass="labeleditwork" ShowToolBarEventName="onmousemove"
    Visible="true" EditEnabled="true" Enabled="true" MouseOverCssClass="labelmouseover"></DNN:DNNLabelEdit>
<DNN:DNNToolBar ID="UserProfileWittyOneLinerToolbar" runat="server" CssClass="toolbar"
    DefaultButtonCssClass="toolbarbuttonimg" DefaultButtonHoverCssClass="colorhover"
    ReuseToolBar="false" MouseOutDelay="25000">
    <DNN:DNNToolBarButton runat="server" ID="UserProfileWittyOneLinerToolbarSave" ControlAction="save"
        ToolTip="Save" CssClass="editInPlaceSave" />
    <DNN:DNNToolBarButton runat="server" ID="UserProfileWittyOneLinerToolbarCancel" CssClass="editInPlaceCancel"
        ControlAction="cancel" ToolTip="Cancel" />
</DNN:DNNToolBar>



And:


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DotNetNuke.Entities.Modules;
using DotNetNuke.UI.Utilities;

public partial class SimpleLabelEdit : PortalModuleBase, IClientAPICallbackEventHandler
{
    protected override void OnInit(EventArgs e)
    {
        //base.OnInit(e);
        ClientAPI.HandleClientAPICallbackEvent(Page);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (browserSupportsAjax())
        {
            registerClientScripts();
        }
        string txt = (string)Application.Get("EDITTEXT");
        if (txt == null || txt.Length <= 0)
            txt = "DefaultText";
        DNNLabelEdit1.Text = txt;
        UserProfileWittyOneLinerEditLabel.Text = txt;
    }

    private void registerClientScripts()
    {
        ClientAPI.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn_xml);
        ClientAPI.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn_xmlhttp);
    }

    private bool browserSupportsAjax()
    {
        return ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XML) && ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XMLHTTP);
    }
    #region IClientAPICallbackEventHandler Member

    public string RaiseClientAPICallbackEvent(string eventArgument)
    {
        Application.Add("EDITTEXT", System.DateTime.Now.ToString() + " - " + eventArgument);
        return System.DateTime.Now.ToString() + " - " + eventArgument;
    }

    #endregion
}


Furthermore I got this Module Load Exception:

ModuleId: -1
ModuleDefId: -1
FriendlyName:
ModuleControlSource:
AssemblyVersion: 04.04.00
PortalID: 0
PortalName: My Website
UserID: 1
UserName: host
ActiveTabID: 36
ActiveTabName: Home
RawURL: /DNN440/Home/tabid/36/Default.aspx
AbsoluteURL: /DNN440/Default.aspx
AbsoluteURLReferrer: http://localhost/DNN440/Home/tabid/36/Default.aspx
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 1f9f91c8-8673-402d-8648-3d0c7a0f1716
InnerException: [L]Unhandled Error Adding Module to TopPane
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Threading.Thread.AbortInternal
StackTrace:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: [L]Unhandled Error Adding Module to TopPane ---> System.Threading.ThreadAbortException: Thread was being aborted.at System.Threading.Thread.AbortInternal()at System.Threading.Thread.Abort(Object stateInfo)at System.Web.HttpResponse.End()at DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Page objPage, CallBackTypeCode eType)at DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Page objPage)at SimpleLabelEdit.OnInit(EventArgs e) in c:\DEVEL\dotnet\DNN440\DesktopModules\SimpleEditInPlace\SimpleLabelEdit.ascx.cs:line 19at System.Web.UI.Control.InitRecursive(Control namingContainer)at System.Web.UI.Control.InitRecursive(Control namingContainer)at System.Web.UI.Control.InitRecursive(Control namingContainer)at System.Web.UI.Control.InitRecursive(Control namingContainer)at System.Web.UI.Control.AddedControl(Control control, Int32 index)at System.Web.UI.ControlCollection.Add(Control child)at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings)--- End of inner exception stack trace ---

Kind regards
Torres
 
New Post
2/5/2007 2:05 AM
 
Thank you businenss3! But the solution is:
just add OnUpdateLabel="myUpdateFunction"!

Thank you
Torres
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPISimple example problemSimple example problem


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