473,382 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Custom TextBox control

149 100+
Hi,

I've successfully created a custom TextBox class based on 'TextBox', I have assigned a render method to encode the bound data into html encoded text.

Like this;

Expand|Select|Wrap|Line Numbers
  1. public class TextField : TextBox
  2.     {
  3.         public virtual string Text
  4.         {
  5.             get
  6.             {
  7.                 string s = (string)ViewState["Text"];
  8.                 return (s == null) ? String.Empty : s;
  9.             }
  10.             set
  11.             {
  12.                 ViewState["Text"] = value;
  13.             }
  14.         }
  15.  
  16.         protected override void Render(HtmlTextWriter writer)
  17.         {
  18.             writer.Write(Text);
  19.         }  
  20.     }
Great! Now I render the page and would like to edit my text. But the text is no longer editable, does anyone know how I can still make this text editable?

I know I could try a Rich Text Editor but I just want the plain text edited and keep the tags as they are.

Help appreciated.
Jul 28 '07 #1
3 1421
radcaesar
759 Expert 512MB
http://p2p.wrox.com/topic.asp?TOPIC_ID=32854
Jul 28 '07 #2
rsdev
149 100+
Thanks radcaesar,

That post wasn't quite what I was looking for. Basically I want to build a rich text editor that inherits the textbox control rather than using an iframe... With basic functionality (no toolbars etc.)

Thanks.
Jul 28 '07 #3
radcaesar
759 Expert 512MB
For that u have to customize and override all the functionalities.

Refer this

http://www.c-sharpcorner.com/UploadFile/scottlysle/TextCaseControls04012007213722PM/TextCaseControls.aspx
Jul 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ryan Joseph So | last post by:
Hi, I've been searching the web for custom textbox control that doesn't inherit from Windows textbox control but cannot find one. I've been trying to make my own custom textbox but I just dont...
0
by: Steve R | last post by:
I've built a composite web custom control with a lot of child controls. I assigned ToolTip values to some of these controls. The ToolTip pop-ups were working fine until I monkeyed with the order...
10
by: Rigs | last post by:
Hi, I have a textbox with a Custom Validator that utilizes the OnServerValidate method for that textbox. This works fine, however the method only executes when data exists in that textbox after...
1
by: Sanjay Pais | last post by:
I built a custom control for all the basic web.ui.controls like textbox, label, checkbox etc etc. I added my custom attribute called ApplySecurity to the html in the page. However, when I cycle...
1
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' &...
0
by: rn5a | last post by:
A custom control is derived from the WebControl class & encapsulates a TextBox & a Button. When the Button is clicked, the user is shown the JavaScript confirm dialog with the 'OK' & 'Cancel'...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
by: Michal Valent | last post by:
I would like to fire some custom server control event before Page_Load event like this (from the trace of an aspx page) : Trace Information Category Message From First(s) From Last(s) aspx.page...
7
by: adiel_g | last post by:
Hello Everyone, I created a custom control. On the CreateChildControls, I added a textbox to the control as follows: // TextBox TextBox txtValue = new TextBox(); txtValue.ID = "txtValue"; ...
4
by: Jeff | last post by:
hi asp.net 2.0 I have created a custom web control, here is it's header: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="EditUserBox.ascx.cs" Inherits="Controls_EditUserBox" %> ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.