Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Placing control tag text in a multiline TextBox

Reply
Thread Tools

Placing control tag text in a multiline TextBox

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-03-2008
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-03-2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-03-2008
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
(E-Mail Removed)
http://www.nathansokalski.com/

"Eliyahu Goldin" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing control tag text in a multiline TextBox Nathan Sokalski ASP .Net Web Controls 2 01-03-2008 05:42 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Placing the form tag within dynamically generated text... Stu ASP .Net 4 01-06-2005 03:31 PM
how to define a variable to hold a multiline text input in perl from html multiline textbox dale zhang Perl Misc 8 11-30-2004 06:53 AM
Adding a carriage return to text in a multiline textbox in design view. Simon Middlemiss ASP .Net 2 11-10-2003 09:08 AM



Advertisments