FreeTextBox

The no. 1 free ASP.NET HTML Editor.
Welcome to FreeTextBox Sign in | Join | Help
in Search

non breaking space

Last post 09-01-2008, 11:18 PM by n8nt. 0 replies.
Sort Posts: Previous Next
  •  09-01-2008, 11:18 PM 9410

    non breaking space

    When I have spaces inside my edited web page they show up ok in the FreeTextBox control and in the html they show up as &nbsp; strings. However, when I read the string out of the FreeTextBox and copy that string into the space occuppied by {CONTENTS} and then display that page, the spaces become funny characters. If I look at the data coming when I do string x = FreeTExtBOx1.TExt then I see <p>   </p> where I would expect to see <p>&nbsp;&nbsp;</p> etc.

    Any way to make that happen?

    I searched around and it seems this problem has been around awhile.

    Hers's my code to read it out of the text box and copy it to my user's page:

    string outputText = FreeTextBox1.Text;
    string path = Request.PhysicalApplicationPath;
    path +=
    @"/Committees/CustomPageTemplate.aspx";
    StreamReader sr = new StreamReader(path);
    string content = sr.ReadToEnd();
    string newContent = content.Replace("{CONTENTS}", outputText);
    string outpath = Request.PhysicalApplicationPath;
    outpath +=
    @"/Committees/CustomPage1.aspx";
    StreamWriter sw = new StreamWriter(outpath);
    sw.Write(newContent);
    sw.Flush();
    sw.Close();

    Here is the contents of the path above:

    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CustomPage1.aspx.cs" Inherits="Committees_CustomPage1" Title="Untitled Page" %>

    <asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server">

    {CONTENTS}

    </asp:Content>

     

    Any ideas?

    Thanks

View as RSS news feed in XML
www.freetextbox.com