473,386 Members | 1,752 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,386 software developers and data experts.

Placing control tag text in a multiline TextBox

I have a multiline TextBox that I want to display the text used to create a
control in an apsx file. I want each of these to be on a separate line in
the TextBox. The only way I know of to place things on separate lines in a
TextBox without doing it programmatically is the following:

<asp:TextBox ID="txtMultiLine" runat="server" TextMode="MultiLine">
Line 1
Line 2
Line 3
</asp:TextBox>

However, if I do something like the following:

<asp:TextBox ID="txtMultiLine" runat="server" TextMode="MultiLine">
<NJS:MyCustomControl ID="MyCtrl1" runat="server"/>
<NJS:MyCustomControl ID="MyCtrl2" runat="server"/>
<NJS:MyCustomControl ID="MyCtrl2" runat="server"/>
</asp:TextBox>

I receive a Parser Error that says:

Parser Error Message: The 'Text' property of 'asp:TextBox' does not allow
child objects.

Is there any way to avoid this problem without adding the text
programmatically? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Jan 3 '08 #1
2 5785
Try something like
&lt;NJS:MyCustomControl ID="MyCtrl1" runat="server"/&gt;

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:u6**************@TK2MSFTNGP06.phx.gbl...
>I have a multiline TextBox that I want to display the text used to create a
control in an apsx file. I want each of these to be on a separate line in
the TextBox. The only way I know of to place things on separate lines in a
TextBox without doing it programmatically is the following:

<asp:TextBox ID="txtMultiLine" runat="server" TextMode="MultiLine">
Line 1
Line 2
Line 3
</asp:TextBox>

However, if I do something like the following:

<asp:TextBox ID="txtMultiLine" runat="server" TextMode="MultiLine">
<NJS:MyCustomControl ID="MyCtrl1" runat="server"/>
<NJS:MyCustomControl ID="MyCtrl2" runat="server"/>
<NJS:MyCustomControl ID="MyCtrl2" runat="server"/>
</asp:TextBox>

I receive a Parser Error that says:

Parser Error Message: The 'Text' property of 'asp:TextBox' does not allow
child objects.

Is there any way to avoid this problem without adding the text
programmatically? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Jan 3 '08 #2
That was not my real concern here, my problem was that I cannot and line
breaks. Because the text is being placed inside a TextBox, the br tag will
not work. For the moment, I am simply adding the text in the Init event of
the Page, but that requires me to make sure all the "'s are added correctly,
which is a pain to do. Any ideas?
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:Oo**************@TK2MSFTNGP05.phx.gbl...
Try something like
&lt;NJS:MyCustomControl ID="MyCtrl1" runat="server"/&gt;

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:u6**************@TK2MSFTNGP06.phx.gbl...
>>I have a multiline TextBox that I want to display the text used to create
a control in an apsx file. I want each of these to be on a separate line
in the TextBox. The only way I know of to place things on separate lines
in a TextBox without doing it programmatically is the following:

<asp:TextBox ID="txtMultiLine" runat="server" TextMode="MultiLine">
Line 1
Line 2
Line 3
</asp:TextBox>

However, if I do something like the following:

<asp:TextBox ID="txtMultiLine" runat="server" TextMode="MultiLine">
<NJS:MyCustomControl ID="MyCtrl1" runat="server"/>
<NJS:MyCustomControl ID="MyCtrl2" runat="server"/>
<NJS:MyCustomControl ID="MyCtrl2" runat="server"/>
</asp:TextBox>

I receive a Parser Error that says:

Parser Error Message: The 'Text' property of 'asp:TextBox' does not allow
child objects.

Is there any way to avoid this problem without adding the text
programmatically? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Jan 3 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Suresh Kumaran | last post by:
Hi All, Does anybody know the sytax in VB.NET to write the contents of a multiline text box to a text file? Appreciate help. Suresh
5
by: charliewest | last post by:
I've configured a RangeValidator control on a WebForm, using ASP.NET, and have set the type to string, the max value to 100, and min value to 1, however, the control to validate always throws an...
0
by: DotNetJunkies User | last post by:
Hi All I am developing a site using ASP.Net I want to develop a site that generates forms ( textbox,check boxes etc) automatically ie is from database itself depending on the no of rows in the...
9
by: Charles Law | last post by:
I have a form on which user controls are placed at runtime. When a control is added to the form a handler is added for an event that a high-level object raises, which must be handled by the new...
3
by: Dhana | last post by:
Hi All, I have developed one web application. In that I used aspnet web textBox control. I have set maxlength property for that text box 300 and TextMode property as multiline . When i typed...
11
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
0
by: jwwishart | last post by:
Hi, Weve been doing this sort of thing frequently in ASP.NET but now were working on a project in ASP.NET 2.0 and were having this very strange problem. With the following XHTML... <table...
1
by: Ian Tedridge | last post by:
If I have 3 textboxes on a form plus 1 multiline textbox. How can I add the text from textbox 1 to 3 to the multiline textbox ? I can add the 3 textbox contents to one line of the multiline...
2
by: dancer | last post by:
Using Framework 1.1 and Asp.Net Does the Asp control Validation Summary work in 1.1?
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.