Click here to Skip to main content
11,927,711 members (54,259 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET XML

I would like to design one xml text editor which is based on normal text-box which implements all XML characteristics.
1. Can any one give me the idea how i could process the each and every character entered by the user(normally we can call the TextBox1_TextChanged event after fully entered the text in text-box but i need to call this event each and every character entry)?
I am good in C#, so that i have decided to transform the control to coding page because i already did one editor using console application which read the input character from the user and change the text color.
2. I might be wrong to approach this problem like this way so, give your suggestions, valuable reference links and ideas to accomplish this editor.

Thanks in Advance

Posted 14-Apr-13 22:14pm
Edited 14-Apr-13 22:57pm
BillWoodruff 17-Apr-13 2:59am
Please add some more specifics about exactly what functionality your XML editor will provide

For example: how "smart" does your XML editor need to be: are you going to keep track of nesting levels, and monitor every character: so that if a user enters an extra close-angle-bracket that would render the XML invalid: are you going to catch that right away ... or are you going to scan the text contents for proper nesting closures only when the user triggers it, or the file is saved ?

This CodeProject article shows a complete XML editor (with color syntax highlighting); you can probably get some ideas from it:
CodeNinja-C# 17-Apr-13 3:49am
Hi BillWoodruff, I would like to design XML editor (same as Visual Studio 2008, while creating new XML file that window contain all the properties of XML) in web page. I also updated my question in

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

For your 1st statement use KeyPress event, it will be triggered everytime you hit a key.

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
                MessageBox.Show("is digit");
CodeNinja-C# 17-Apr-13 3:52am
Hi, in text box i don't find "KeyPress" event. how could i achieve it?
Thomas Barbare 17-Apr-13 4:46am
Oh sorry, it's an ASP application... I thought it was windows form.
Do you really wants to do a postback everytime user type ? I think it will cost too much especially if a lot of user are typing at the same time. But if you want to do that consider using Javascript to call the postback with his keypress event.
Hope that help you
CodeNinja-C# 17-Apr-13 8:04am
Hi Thomas, Thanks. you can find my full requirement from following URL

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 17 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100