• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

append text in editor controls asp.net

trying to append text in editor control which comes with

edit01.Value.

Value has following properties as (Aggregate, All, Any, Insert, Join...etc)

but trying to find the properties call 'Append', which allows edit01.Value to append text after apple with word banana

eg.
apple banana (appended)

was trying to use += , but the editor will add after the following line
eg.
apple

banana
0
doramail05
Asked:
doramail05
  • 2
1 Solution
 
fourckCommented:
hi,

its better that you concatenate all your string first, and when done simply assign it to the textBox (edit01.value = yourFinalString) instead.


if after doing that, problem persist, you should tell me where does 'banana' comes from (input fiesl, variable, ....)

Good Luck!
0
 
Rajar AhmedConsultantCommented:
Try stringbuilder for better performance , "\n" this will acts as next line in textbox .
using System.Text;

public partial class cs_txtApeend : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        StringBuilder strbilder = new StringBuilder();
        strbilder.Append("apple");
        strbilder.Append("\n");
        strbilder.Append("banana");
        edit01.value = strbilder.ToString();
    }
}

Open in new window

0
 
fourckCommented:
Hi,

in the meeran03 solution, he added a "\n", which doramail05 is trying to prevent.
so the solution should be like that:

using System.Text;

public partial class cs_txtApeend : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        StringBuilder strbilder = new StringBuilder();
        strbilder.Append("apple");
        strbilder.Append("banana");
        edit01.value = strbilder.ToString();
    }
}
                                            

Open in new window


Good Luck!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now