The RichTextBox maintains its state in a hidden control and there's a client side function that must be called in order to do this. In certain cases when a postback is caused by another element on the page the appropriate events are not fired so the function doesn't get called on the postback to the server.
If you’re experiencing this problem, then you should add the onclick event to the control causing the postback and add the appropriate javascript function –
In .aspx -
<asp:button id="Button1" runat="server" Text="Postback"></asp:button>
In .aspx.cs -
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender (e);
this.Button1.Attributes.Add("onclick", "CopyDataRichTextBox1()");
}
In this case RichTextBox1 is the RichTextBox ID, so if it’s different then you’ll need to change the function call.
Alternatively you could wire this to the body onbeforeunload event like the following -
<body id="body1" onbeforeunload="CopyDataRichTextBox1()">