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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Assigning DotNetNuke.UI.UserControls.TextEditor.Text in codebehindAssigning DotNetNuke.UI.UserControls.TextEditor.Text in codebehind
Previous
 
Next
New Post
10/15/2014 1:20 AM
 

I have a TextEditor in a repeater and binding the Text does not work, also when trying to assign the .Text in OnItemDataBound I get the dnntexteditor.Text' threw an exception of type 'System.NullReferenceException error on the get_Text()

 Is there a way to assign a TextEditor a text value in a repeater by either binding on page load or in the OnItemDataBound?

 
New Post
10/15/2014 4:32 AM
 
Hi William,

I would do this via the ItemDataBound function of the datagrid in codebehind:

Below is code for a dropdown added in runtime but you should replce this with a Texteditor:

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then

Dim ddlClub As DropDownList = DirectCast(e.Item.FindControl("ddlClub"), DropDownList)
Dim tc As New ShirtController

For Each t As Shirt In tc.GetShirts(ModuleId)
ddlClub.Items.Add(New ListItem(t.ShirtName, t.ShirtId))
Next
ddlClub.Items.Insert(0, New ListItem("-", "-1"))
end if

To read the values:

For Each dlistItem As DataListItem In ddlClubs.Items
Dim t As New Team

Dim dc As DropDownList = DirectCast(dlistItem.FindControl("ddlClub"), DropDownList)
t.PlayerId = CInt(pId.Text.Trim)

Next

Hope this helps you out,

Regards,
Geoff

      
 
New Post
10/15/2014 9:12 AM
 
Geoff,

I was referring specifically to the DNN TextEditor. I have other controls being assigned values in the OnItemDataBound but for some reason the TextEditor is throwing the error when trying to assign a text value to it.

Can anyone else help?
 
New Post
10/15/2014 9:13 AM
 
Geoff,

I was referring specifically to the DNN TextEditor. I have other controls being assigned values in the OnItemDataBound but for some reason the TextEditor is throwing the error when trying to assign a text value to it.

Can anyone else help?
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Assigning DotNetNuke.UI.UserControls.TextEditor.Text in codebehindAssigning DotNetNuke.UI.UserControls.TextEditor.Text in codebehind


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