Welcome Guest Search | Active Topics | Sign In | Register

Usercontrol HTML editor properties Options
SpongeBert
Posted: Tuesday, August 25, 2009 9:18:15 AM
Rank: Member
Groups: Member

Joined: 8/25/2009
Posts: 10
Hello,

I have added demo.ascx in my website. I dragged this into my design view page.
I get following code:
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
...
<uc2:Demo ID="ProbPed" runat="server" />

Now I want to save the content in my server side event.
I see the ID but the html property is not there.

If you can help me out, I will buy the suite.
Kind regards,
Bert
eo_support
Posted: Tuesday, August 25, 2009 9:27:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Do you mean you have an eo:Editor control inside your uc2:Demo user control and you want to be able to set/get the editor's Html property directly on uc2:Demo user control?

If that's the case, the cleanest way is for you to expose a new property on your user control:

Code: C#
public class Demo: System.Web.UI.UserControl
{
    //Define a new property "Whatever" on your Demo user control.
    //As you can see, this property is merely a wrapper for Editor.Html    
    public string Whatever
    {
        get { return Editor1.Html; }
        set { Editor1.Html = value; }
    }
}


Once you have the new property on your UserControl, you can use it in your .aspx or code behind:

Code: HTML/ASPX
<uc2:Demo ID="ProbPed" runat="server" Whatever="Editor Content" />


Or:

Code: C#
ProbPed.Whatever = "Some html";


Hope this helps.

Thanks
SpongeBert
Posted: Tuesday, August 25, 2009 10:06:12 AM
Rank: Member
Groups: Member

Joined: 8/25/2009
Posts: 10
yes, this is it!

Is html the right property? I cannot find text-property? ...
eo_support
Posted: Tuesday, August 25, 2009 10:10:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great! So ready to buy the suite now? :)

Please feel free to let us know if you have any other questions.

Thanks!
SpongeBert
Posted: Tuesday, August 25, 2009 10:12:38 AM
Rank: Member
Groups: Member

Joined: 8/25/2009
Posts: 10
Almost ready for buying (just one more topic :) ) ! Great support!

Is html the right property? I cannot find text-property? ...

eo_support
Posted: Tuesday, August 25, 2009 10:17:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No problem. We are working on the other topic and we are waiting for more information from you.

Yes. Html is the right property. I don't think there is a Text property on the Editor.
SpongeBert
Posted: Tuesday, August 25, 2009 1:10:40 PM
Rank: Member
Groups: Member

Joined: 8/25/2009
Posts: 10
Hi,

While you tell me how to do this for width and heigth (type = unit), I get my credit card!

Great support!
Thanks
eo_support
Posted: Tuesday, August 25, 2009 1:17:00 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I believe it's the same, you simply replace "Html" with "Width" or "Height". Please let us know this works for you:

Code: C#
public Unit EditorWidth
{
    get { return Editor1.Width; }
    set { Editor1.Width = value; }
}

public Unit EditorHeight
{
    get { return Editor1.Height; }
    set { Editor1.Height = value; }
}


Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.