.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

RichTextBox save content as rtf is it a bug?

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :WPF

Hello guys

I have a problem to use RichTextBox

we use a RichTextBox, its direction is rtf and we write to it some multilevel list like





after save text of RichTextBox as Rtf format and reload this rtf text(or open it in MSWord)it destroys list format and spaceing of text, in new format it shows it likes



1.    aaa

2.     bbb

I test it in different situation: if Direction will be LTR it works fine

If load  destroyed text in RichTextBox and save it again it save destroyed text in true format

It seems destroyed format text has 2 more character that destroys text.

Is it a bug?

Thanks for any help or Idea

View Complete Post

More Related Resource Links

How to save WPF RichTextBox content (text + image) to the database



I want to save (and after that also to retrieve) the content of an WPF RichTextBox (text + image) to/from the database.

I found this: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/750a654e-b002-4742-8f46-609e93f6ec81 but like the author said, the solution seams not to work for text with image - the image is ignored/removed and only the formatted text is saved and after that retrieved to/from database.

Know someone a solution about this issue?

Best regards,





InfoPath 2007 Form Content Type does not save as infopath form but as xml document.


I have a couple of infopath forms deployed to sharepoint as content types. Normally, when a user creates a new document of an infopath content type, the form opens in browser mode and ,when the user fills in the form and saves the form, a new document is created in the document library with the correct icon and progid.

This was before... Now, whenever I save a form, the form submits correctly, i see the file in de document library, BUT it has the icon of an XML document, all the infopath functionality is gone and when I click the file, I get a save as dialog...

The form itself hasn't changed that much and even when I redeploy a version that worked before it still does not work. However, when I create a new doc lib and associate the malfunctioning form there, the behavior is normal and i can still reopen the saved form.


Little sidenote: I have 7 different forms that now do not work on my test machine. It used to be only one, but after redeploying them, all of them have the same problem. Now when I deployed these forms in a production environement, the same thing started happening there. So I stopped the deployment and in production there is just the newly deployed form that does not work.

I have already tried reassociating the form to the doc lib. And everything looks normal in central administration.

Any suggestions?


Save text box content as a text file in sharepoint 2010 document library


I am a sharepoint developer and currently I am trying to save content of a text box from client side in document library in share point 2010. I have created a sandbox solution for this. I explored the SP2010 client side object model for ECMA script, however I was not able to crack the problem.

I have created the byte array from the text box content and now I want to save it as a text file in the document library using ECMA script.

Kindly suggest how can I achieve that.

Content Editor WebPart Cannot retrieve properties or save changes


When a content editor webpart is open for editing - if they use the Rich Text Editor the error message is "Cannot retrieve properties at this time

If they use the Source Editor - they can make changes but it give them the message "Cannot save changes"

Sheryl L Fackler

SharePoint Tutorial - Content Types

SharePoint content types provide users with a way to manage and organize content in a more meaningful way. It's a reusable of settings you want to apply to a particular type of document in a library or item in a list.

Enabling Users to Maintain SharePoint Content

When SharePoint is installed as a corporate intranet, there is a considerable amount of effort involved in maintaining the content to keep the site relevant. As we discussed in the first few parts of this series, SharePoint has many built-in features to reduce the burden on the site administrator.

Some areas of the site usually contain less-dynamic information. Internal memos and corporate policies are common examples of this information. One option for this information is to post these documents in a document library. Documents in a library are often stored in a few different formats: Word, Acrobat (PDF), or HTML. Each of these formats has its drawbacks.

Application Vs. Content Pages in SharePoint

SharePoint has two types of ASPX pages. One type is the application page, also known as a _layout page. The other type of ASPX page is a content page, also known as a site page. Each of these page types is stored in a different location in SharePoint. When developers create custom ASPX pages, they must decide on the page type.

Enabling Users to Maintain SharePoint Content

When SharePoint is installed as a corporate intranet, there is a considerable amount of effort involved in maintaining the content to keep the site relevant. As we discussed in the first few parts of this series, SharePoint has many built-in features to reduce the burden on the site administrator.

Content Types in MOSS 2007

In this article I will try to describe the one of the best feature in Microsoft office Share Point 2007 called Content Types.

Content types are simply collection of contents.Each content in a Content type can have different settings.Basically it is a reusable collection of settings which you want to apply to a particular category of contents.

Content Query Web Part missing in SharePoint 2010

If you don't see content query web part listed in the web parts list, this is because you have not enabled "Search Server Web Parts" feature in site collection features. Enable this feature and content query web part will show in the list of web parts.

Save images to SQL CE

Storing binary objects (such as image, office document etc.) into database is a little cumbersome when it comes to retrieval. Hence the most commonly accepted way is only store the file path in the database, and to store the documents on a file share.

Unique content within master page based on conditions met


 Hi all-

I would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx).  The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. 

However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML,  Divs and databound gridview content.  The HTML content will be stored in the database.

Can someone point me in the right direction for best practices on how to accomplish this?


Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

Profile not being save after redirect.



I am trying to save values into a Profile on Page1, then redirect to Page2 and access those values.  However, after the page redirects the profile values are blank as if they were never saved.   When stepping through the code I can see that they are being save on Page 1.

I suppose I could use session variables to store the information but I don't understand why saving the profile doesn't work.

private void PayWithPayPal()
        ProfileCommon profile = this.Profile;

        if (Global.CurrentUserName.Length > 0)
            profile = this.Profile.GetProfile(Global.CurrentUserName);
        profile.FirstName = uxFirstNameShipping.Text;
        profile.LastName = uxLastNameBilling.Text;
        profile.ShippingAddress.AddressLineOne = uxAddressLineOneShipping.Text;
        profile.ShippingAddress.AddressLineTwo = uxAddressLineTwoShipping.Text;
        profile.ShippingAddress.City = uxCityShipping.Text;
        profile.ShippingAddress.State = uxStateShipping.Text;
        profile.ShippingAddress.ZipCode = uxPostalCodeShipping.Text;

        Response.Redirect("~/expresspayment.aspx", false);

protected void Page_Load(object sender, EventArgs e)
        ProfileCommon p

How to save Unicode in SQL Server 2005

I am using google transliteration to display the text in Hindi/Tamil

I tried to store the text appear as Hindi from textarea in an nvarchar
field of database (SQL Server 2005) , the text saved as "???????".

After retireving text from the same it display the text as "???????".

Can anyone help me how to store and retrieve the actual data from SQL
Server 2005?

I am using ASP.net,VB.Net and SQL Server 2005

Composite Control which contains arbitrary content defined in .aspx of parent and thier ViewState


I want to write own control which can contain other. And I want to define content of the control in the .aspx file where the control is defined. I have written such control. But now I have issue with ViewState of inner controls of my control. The following samle illustrates the issue: I defined two asp:DropDownList ID="ddl1" and ID="ddl2" One of them is inside of my control and other is outside. When posback is occurred asp:DropDownList ID="ddl1 loses state and becomes empty. How to say ASP.net to store state of inner controls defined by this way?


<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyControl.ascx.cs" Inherits="DynamicControls.Controls.MyControl" %>

<div class="box">
    <div class="Header-Left">
        <div class="Header-Right">
            My Control
    <div class="Content">
        <asp:PlaceHolder ID="contentPlace" runat="Server" />

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend