• 0

ASP.NET WYSIWYG Editor...


Question

Good Day...

I'm in the middle of creating a CMS and for ease of use and addition of extended flexibility I've decided to give the option to allow editing of the content via a WYSIWYG editor.

Because I can use it freely until I finish the CMS (at which point it may be distributed for monies in which I'll need a distrobution license) I had decided to use John Dyers FreeTextBox (http://www.freetextbox.com). Not only is it free for personal use, but it includes a really sharp ImageGallery control and is faster than some of the others out there as well. Also worth mentioning, it's a fully encapsulated solution now... you don't need to copy IMAGES and JS files... only the DLL and everything is stored within it. That makes rollout NICE...

Anyway, I'm having some problems with it... using IE, goto http://joshandbrandi.com/post.aspx?PostID=1. The FTB control is at the bottom of the page. Within it "undefined" is displayed. Not only that, but if I change that and try to add anything it doesn't post correctly. I cannot figure out what's causing this.

The funny thing is that using FireFox the error DOES NOT show up and the control works fine!!! Does anybody have any ideas on this?

Link to comment
https://www.neowin.net/forum/topic/303693-aspnet-wysiwyg-editor/
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Nice try on the IE7 thing... I forgot I even had that in there. However, even after removing it, I'm still getting this wierd problem.

And since I'm not being shy... here's the page code... nice and simple you'll see...

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" ValidateRequest="False" Src="_global.vb" Inherits="Global" %>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script runat="server">

	Sub Page_Load()
  If NOT(Page.IsPostBack) Then
  	LoadPost()
  	LoadReplies()
  End If
	End Sub

	Sub LoadPost()
  dim strSQL as string = "SELECT PostID, Author, [Date], Header, Post FROM Post WHERE Approve=1 AND PostID=" & Request.QueryString("PostID")
  rptPost.Datasource = GetData(strSQL)
  rptPost.Databind()
	End Sub

	Sub LoadReplies()
  dim strSQL as string = "SELECT ReplyID, Author, [Date], Post FROM Reply WHERE PostID=" & Request.QueryString("PostID") & " ORDER BY [Date] ASC"
  rptReply.Datasource = GetData(strSQL)
  rptReply.Databind()
	End Sub

	Function CountReplies(ByVal PostID As String) As String
  dim strSQL as string = "SELECT COUNT(*) AS Replies FROM Reply WHERE PostID=" & PostID
  return GetScalar(strSQL)
	End Function

	Sub PostReply(ByVal Sender As Object, ByVal e As EventArgs)
  dim strSQL as string = "INSERT INTO Reply (PostID, [Date], Author, Post) VALUES (@PostID, @Date, @Author, @Post)"
  dim C as New SQLCommand(strSQL, Conn)
  With C.Parameters
  	.Add(New SQLParameter("@PostID",Request.QueryString("PostID")))
  	.Add(New SQLParameter("@Date",Now()))
  	.Add(New SQLParameter("@Author",Author.Text))
  	.Add(New SQLParameter("@Post",Reply.Text))
  End With
  PostData(C)
  LoadPost()
  LoadReplies()
	End Sub

</script>

<!--#include file="_header.inc" -->

<h1>Post And Replies</h1>

<asp:Repeater ID="rptPost" runat="server">
	<itemtemplate>
  <h2><%# DataBinder.Eval(Container.DataItem, "Header") %></h2>
  <span class="postinfo">by: <span class="postinfoaugment"><%# FormatEmail(DataBinder.Eval(Container.DataItem, "Author")) %></span> on 
  <span class="postinfoaugment"><%# AdjustTime(DataBinder.Eval(Container.DataItem, "Date")) %></span></span>
  <p><%# DataBinder.Eval(Container.DataItem, "Post") %></p>
  <p><a href="#reply">Reply To Post</a>: Currently there are <%# CountReplies(DataBinder.Eval(Container.DataItem, "PostID")) %> replies.</p>
	</itemtemplate>
</asp:Repeater>

<p> </p>

<h3>Replies...</h3>
<asp:Repeater ID="rptReply" runat="server">
	<itemtemplate>
  <p><span class="replyinfo">by: <span class="postinfoaugment"><%# FormatEmail(DataBinder.Eval(Container.DataItem, "Author")) %></span> on 
  <span class="postinfoaugment"><%# AdjustTime(DataBinder.Eval(Container.DataItem, "Date")) %></span> 
  &lt;a href="work.aspx?Type=Reply&Action=Delete&ID=<;%# DataBinder.Eval(Container.DataItem, "ReplyID") %&gt;" onclick="return smallWin(this.href);">&lt;img class="noborder" src="images/delete.gif" alt="Request Deletion" /&gt;
  &lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
  &lt;%# DataBinder.Eval(Container.DataItem, "Post") %&gt;&lt;/p&gt;
	&lt;/itemtemplate&gt;
&lt;/asp:Repeater&gt;

&lt;p&gt; &lt;/p&gt;

&lt;a name="reply" id="reply"&gt;&lt;/a&gt;
&lt;form runat="server"&gt;
	&lt;div id="replybox"&gt;
  &lt;p&gt;Your Email Address: &lt;asp:TextBox ID="Author" runat="server" MaxLength="128" /&gt;&lt;/p&gt;
  &lt;p&gt;Your Reply:&lt;br /&gt;
  	&lt;FTB:FreeTextBox id="Reply" runat="server"
    ToolbarStyleConfiguration="Office2003"
    ToolbarLayout="bold,italic,underline,JustifyLeft,JustifyRight,JustifyFull,JustifyCenter,FontForeColorPicker,FontSizesMenu|cut,copy,paste,delete|bulletedlist,numberedlist|createlink,Unlink,InsertImageFromGallery,IeSpellCheck"
    BreakMode="Paragraph"
    ConvertHtmlSymbolsToHtmlCodes="True"
    DesignModeCss="_ftb.css"
    DownLevelMode="TextArea"
    DownLevelCols="100"
    DownLevelRows="10"
    EnableHtmlMode="False"
    FormatHtmlTagsToXhtml="True"
    PasteMode="Text"
    RemoveServerNameFromUrls="True"
    StripAllScripting="True"
    TabMode="InsertSpaces"
    Height="175"
    Width="100%"
  	/&gt;
  &lt;/p&gt;
  &lt;p&gt;&lt;asp:Button ID="btnPostReply" runat="server" Text="Submit" OnClick="PostReply" /&gt;&lt;/p&gt;
	&lt;/div&gt;
&lt;/form&gt;

&lt;!--#include file="_footer.inc" --&gt;

  • 0

Nothing stands out but

 ToolbarLayout=&amp; #34;bold,italic,underline,JustifyLeft,JustifyRight,JustifyFull,JustifyCenter,FontForeColorPicker,FontSizesMenu|cut,copy,paste,delete|bulletedlist,numberedlist|createlink,Unlink,InsertImageFromGallery,IeSpellCheck"

Looks like your using & #34; instead of " in the ToolbarLayout setting.

Also do you have the freetextbox jscripts ( i think there are 5 of them) in \aspnet_client\FreeTextBox directory?

  • 0

Neowin converted those to ASCII equivs... they're not like that in the code itself.

No, I don't have the scripts. This is version 3.0.3 and is fully self contained. Very nice actually. But do you see how it works in FF but not IE? This is freaking me out and I'm not getting ANYWHERE on the FTB forums... they're kinda dead at the moment.

  • 0

Try just putting the control in, no settings and see what happens. Like

&lt;FTB:FreeTextBox id="Reply" runat="server"/&gt;

If it works, slowly add each setting and see when the problem comes up.

  • 0

It still does it. I'm not sure exactly what happened... it worked at first, and then after adding the toolbaritems and other properties (I did all at once) it started messing up like that... but only in IE.

Am I the only one having this problem or does anybody else experience this too?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • That's not Pinocchio. That's a twink boy with a robot arm. Even the puppet is a lie in Lies of P!
    • I have a question on W11. Do VLC Player ( not the Store version ) and QBitorrent work with W11?
    • Splitgate 2 gets a surprise battle royale mode just as the free-to-play game releases by Pulasthi Ariyasinghe The highly anticipated arena shooter with portals, Splitgate 2, has just been released across PC and consoles as a free-to-play experience. At the same time, the studio head appeared on the Summer Game Fest showcase's stage today with a surprise reveal, showing off a brand-new battle royale mode that is a part of the game and is also launching today for free. Watch the action-packed trailer above. The sci-fi shooter franchise by 1047 Games has not breached the battle royale space before, but it seems the studio has been working secretly on the project all this time for this surprise reveal and launch. The Splitgate 2 battle royale mode features 60-player showdowns, letting 15 teams, each with four players, compete with each other to be the last squad standing. The map is touted as being an interconnected, gigantic colosseum with five biomes, and players will have to go through massive World Portals to reach each of them and hopefully take down anyone on the other side. "Choose where to drop in across Drought’s scorching desert, Glacier’s slick snowscape, Inferno’s active volcano, or Fracture’s cluster of asteroids," explains the developer. "After landing, players who stay in the match long enough will gain access to a fifth biome – the central area of Sanctum’s foreboding ruins, which offers special, powerful loot for those who can survive sparring to get it." Being a battle royale, there are chests to loot for better armaments, fast-paced action, map events to change up the atmosphere, and plenty of quick action to jump into. Aside from the new mode, with the Splitgate 2 full launch, the studio has delivered four new maps to the arena mode, a fresh map-creating template, as well as the Gravitas Shotgun as a brand-new weapon. It is also working on implementing a ranked mode, even more maps, map reskins, and more content as part of its post-launch support plans. Splitgate 2 is now available on PC (Steam and Epic Games Store), Xbox Series X|S, Xbox One, PlayStation 5, and PlayStation 4.
    • I hate that they have removed settings that we once had, and had them for what feels like forever. Until now.   My desktop icon font are too thin, and too small now in Windows 11 since the last Windows Update. I have been using Winareo Tweaker to set the icon font to bold, and to change the size to a size larger. Now I have to do it twice, loggin out and back in each time, before it finally takes effect on the third time. But wait.... it gets worse. Once the system is shutdown, and turned back on the next day, all of those icon settings are reset to thin, and small.   I see no reason for the previous font customization options we always had now being removed. SO upsetting.   Boo Microsoft. Updates are suppose to be 'better', not removing options we had previously. This is horrible.
    • FWIW the Arc browser is now in "Maintenance Mode" with its developers shifting priorities to a new browser paradigm called Dia -- so investing time/effort into Arc is not recommended (even by the developers themselves!)
  • Recent Achievements

    • Week One Done
      daelos earned a badge
      Week One Done
    • One Month Later
      daelos earned a badge
      One Month Later
    • Mentor
      Karlston went up a rank
      Mentor
    • One Month Later
      EdwardFranciscoVilla earned a badge
      One Month Later
    • One Month Later
      MoyaM earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      492
    2. 2
      snowy owl
      256
    3. 3
      +FloatingFatMan
      252
    4. 4
      ATLien_0
      212
    5. 5
      Xenon
      150
  • Tell a friend

    Love Neowin? Tell a friend!