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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...very very urgent  error in DNN:TEXTEDITORvery very urgent error in DNN:TEXTEDITOR
Previous
 
Next
New Post
7/6/2006 3:38 AM
 

Hai,

i am using DNN:TEXTEDITOR and in FORMVIEW

the problem is

when we typing the text in the texteditor as hello and pressing enter key

then the text stored in the database as follows:

"<P>hello</P> <P> </P> <P> </P>"

i dont know why its storing like this

"plz help me i am in critical situaution"

--

 

following is the code:

<%@ Control Language="VB" Inherits="YourCompany.Modules.GuestBook.ViewGuestBook" CodeFile="ViewGuestBook.ascx.vb"

AutoEventWireup="true" %>

<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>

<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>

<asp:ObjectDataSource ID="ObjectDataSource_Tasks" runat="server" DataObjectTypeName="YourCompany.Modules.GuestBook.GuestBookInfo"

DeleteMethod="GuestBook_Delete" InsertMethod="GuestBook_Insert" OldValuesParameterFormatString="original_{0}"

SelectMethod="GuestBook_GetAll" TypeName="YourCompany.Modules.GuestBook.GuestBookController"

UpdateMethod="GuestBook_Update" OnInit="Page_Load">

<SelectParameters>

<asp:Parameter DefaultValue="00" Name="ModuleId" Type="Int32" />

</SelectParameters>

</asp:ObjectDataSource>

&nbsp;

<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource_Tasks"

AutoGenerateColumns="False" AllowPaging="True" HorizontalAlign="Center" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical">

<Columns>

<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" visible="False" />

<asp:BoundField DataField="Message" HeaderText="Message" SortExpression="Message" />

<asp:BoundField ApplyFormatInEditMode="True" DataField="DateEntered" DataFormatString="{0:d}"

HeaderText="Date" SortExpression="DateEntered" HtmlEncode="False" visible="False" />

</Columns>

<EmptyDataTemplate>

There are no entries.

</EmptyDataTemplate>

<FooterStyle BackColor="#CCCC99" />

<RowStyle BackColor="#F7F7DE" />

<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />

<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />

<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />

<AlternatingRowStyle BackColor="White" />

</asp:GridView>

<br />

<center>

<dnn:Label ID="lblAddMessage" runat="server" ControlName="lblAddMessage" Suffix=":" Visible="false">

</dnn:Label>

</center>

<br />

<asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource_Tasks" DefaultMode="Insert" HorizontalAlign="Center">

<InsertItemTemplate>

<table cellpadding="2" cellspacing="5" style="width: 50%" align="center">

<tr>

<td align="right" style="width: 4px">

<asp:Label ID="Label1" runat="server" Text="Name" Visible="false"></asp:Label></td>

<td style="width: 100px">

<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' Width="264px" Visible="false"></asp:TextBox></td>

</tr>

<tr>

<td align="right" style="width: 4px; height: 23px">

<asp:Label ID="Label3" runat="server" Text="Email" Visible="false"></asp:Label></td>

<td style="width: 100px; height: 23px">

<asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' Width="264px" visible="false" ></asp:TextBox></td>

</tr>

<tr>

<td align="right" style="width: 4px; height: 21px">

<asp:Label ID="Label2" runat="server" Text="Message" Visible ="false" ></asp:Label></td>

<td style="width: 100px; height: 21px">

<dnn:texteditor id="MessageTextBox" runat="server" Text='<%# Bind("Message") %>' width="550" EnableViewState="False" height="250" ChooseMode="false"></dnn:texteditor>

</td>

</tr>

<tr>

<td align="right" colspan="2" style="height: 21px">

<asp:Button ID="InsertButton" runat="server" Text="Submit" CommandName="Insert" /></td>

</tr>

</table>

<br />

&nbsp;

</InsertItemTemplate>

</asp:FormView>

<asp:Button ID="cancel" runat="server" Text="Cancel" />

<asp:Button ID="bt" runat="server" Text="Post Reply" CommandName="Insert" visible="true"/>

------

Imports DotNetNuke

Imports System.Web.UI

Imports System.Collections.Generic

Imports System.Reflection

Imports DotNetNuke.Entities.Modules

Namespace YourCompany.Modules.GuestBook

Partial Class ViewGuestBook

Inherits Entities.Modules.PortalModuleBase

Implements Entities.Modules.IActionable

Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActions

Get

Dim Actions As New Entities.Modules.Actions.ModuleActionCollection

Actions.Add(GetNextActionID, Localization.GetString(Entities.Modules.Actions.ModuleActionType.EditContent, LocalResourceFile), Entities.Modules.Actions.ModuleActionType.EditContent, "", "", EditUrl(), False, Security.SecurityAccessLevel.Edit, True, False)

Return Actions

End Get

End Property

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

'bt.Text = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username

FormView1.Visible = False

If (bt.Text = "") Then

' bt.Text = "unknown user"

End If

Try

Dim objModules As ModuleController = New ModuleController

If Not Page.IsPostBack Then

If (Not (CType(Settings("showform"), String)) Is Nothing) Then

If (CType(Settings("showform"), String) = "No") Then

' Do not allow messages to be added

FormView1.Visible = False

lblAddMessage.Visible = False

End If

End If

Else

Me.GridView1.DataBind()

End If

Catch ex As Exception

Exceptions.ProcessModuleLoadException(Me, ex)

End Try

End Sub

Protected Sub NewItem(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles FormView1.ItemInserting

Dim chec As String

Dim up As String

chec = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username

If chec = "" Then

e.Values.Item("ID") = 0

e.Values.Item("Name") = "UnRegisteredUser" 'DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username

e.Values.Item("ModuleId") = ModuleId.ToString()

e.Values.Item("DateEntered") = DateTime.Now.ToShortDateString

up = ""

up = e.Values.Item("Message").ToString + " -- Posted by " + "UnRegisteredUser" + " On " + Date.Now

e.Values.Item("Message") = up 'e.Values.Item("Message").ToString + " -- Posted by " + "UnRegisteredUser" + " On " + Date.Now

bt.Text = e.Values.Item("Message").ToString

Else

e.Values.Item("ID") = 0

e.Values.Item("Name") = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username

e.Values.Item("ModuleId") = ModuleId.ToString()

e.Values.Item("DateEntered") = DateTime.Now.ToShortDateString

up = ""

up = e.Values.Item("Message").ToString + " -- Posted by " + "UnRegisteredUser" + " On " + Date.Now

e.Values.Item("Message") = e.Values.Item("Message").ToString + " -- Posted by " + DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username + " On " + Date.Now

bt.Text = e.Values.Item("Message").ToString

End If

End Sub

Protected Sub SetModuleID(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectDataSource_Tasks.Selecting

Dim chec As String

chec = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username

If chec = "" Then

e.InputParameters("ModuleId") = ModuleId.ToString

e.InputParameters("Name") = "UnRegisteredUser" 'DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username

Else

e.InputParameters("ModuleId") = ModuleId.ToString

e.InputParameters("Name") = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Username

End If

End Sub

Protected Sub bt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bt.Click

FormView1.Visible = True

End Sub

Protected Sub FormView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs)

End Sub

Protected Sub cancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cancel.Click

FormView1.Visible = False

End Sub

End Class

End Namespace

 
New Post
7/6/2006 5:24 AM
 

It is HTML encoded, that is all.

System.Decode("&lt;P&gt;hello&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;")
 -->                     < P >   hello  < /P >    <  P  >     [Space]    <  /P  >    < P   >   [Space]     <  /P  >

 
New Post
7/6/2006 6:33 AM
 

hello  Stefan Cullmann ,

Thanks For replying

where we should we use system.decode.

i tried to use in code behind file but its showing error

like System class is not having decode method

its very urgent i am  waiting for reply

regards,

Ganapathy.L

 
New Post
7/6/2006 6:43 AM
 
Sorry, I meant Server.Decode()
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...very very urgent  error in DNN:TEXTEDITORvery very urgent error in DNN:TEXTEDITOR


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