Last post Jan 14, 2006 09:00 PM by DataSprings Inc.
Jan 11, 2006 05:27 PM|DataSprings Inc.|LINK
Hi, I am having some issues adding a RichTextbox dynamically via code and was wondering if anyone could provide some help.
Here is what I am trying, I can get it to display but I get errors reading/writing to the richtext properties. For example if I execute this I get an error:
Here is what I have working and loading the control:
Dim myUC25 As UserControl = LoadControl("~/controls/TextEditor.ascx")
DirectCast(myUC25, DotNetNuke.UI.UserControls.TextEditor).ID = "ChooseAnID"
I also adjust a few other properties besides the ID but not sure what is required and what is not.
My question then is:
1. How do I add/remove the toolbars from code?
just nothing from .richtext on.
Response.Write(DirectCast(myUC25, DotNetNuke.UI.UserControls.TextEditor).RichText.ClientID.ToString) would return an error
but this would not.
Any help would be appriciated.
Jan 11, 2006 08:33 PM|thecrispy1|LINK
I haven't tried to dynamically add FTB to a page, or any other html provider for that matter. One thing I can say is if you want to add/remove toolbar items the proper way to handle this is in the actual provider implementation itself. The reason is not
all editors are going to behave the same and until the core adds generic calls for things like this it might not be the best idea unless the goal is for a custom module you intend on using yourself or for a client and not one you are going to sell to the public.
(Support nightmare otherwise)
We ran across this problem (toolbar items) when developing the forum. In the forum you will see the smiley, images buttons are seperate for this very reason.
Jan 12, 2006 06:07 PM|DataSprings Inc.|LINK
Thanks again, if anyone has any suggestions let me know.
Jan 13, 2006 12:47 PM|nettech|LINK
This works for me...
Dim ctlControl As System.Web.UI.Control
ctlControl = LoadControl("~/controls/TextEditor.ascx")
ctlControl.ID = "txtEditor"
Hope it helps.
Jan 14, 2006 09:00 PM|DataSprings Inc.|LINK
Do you have any other properties set besides ID?
Thanks for your help.