473,326 Members | 2,148 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,326 software developers and data experts.

User control with sub controls

PEK
I know how to create and use user controls, by I find them sometimes to
limited. I sometimes want to creating something like this:

<test:mycontrol runat="server">
<p>Some text</p>
</test:mycontrol>

I also want to do something like this:

<test:mymenu runat="server">
<test:mymenuitem>Item 1</test:mymenuitem>
<test:mymenuitem>Item 2</test:mymenuitem>
<test:mymenuitem>Item 3</test:mymenuitem>
<test:mymenuitem>Item 4</test:mymenuitem>
</test:mymeny>

But when I tries do that in a control a gets an error message like
"Literal content ('xyz') is not allowed within a
'ASP.thecontrol_ascx'". Is it possible to solve this problem?

PEK

Nov 19 '05 #1
3 1000
The best resource I've found for helping build custom controls like this
is "ASP.NET Server Controls and Components". It goes into good detail showing
how to design & build controls (and how to apply the custom attributes) to
get what you want.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know how to create and use user controls, by I find them sometimes
to limited. I sometimes want to creating something like this:

<test:mycontrol runat="server">
<p>Some text</p>
</test:mycontrol>
I also want to do something like this:

<test:mymenu runat="server">
<test:mymenuitem>Item 1</test:mymenuitem>
<test:mymenuitem>Item 2</test:mymenuitem>
<test:mymenuitem>Item 3</test:mymenuitem>
<test:mymenuitem>Item 4</test:mymenuitem>
</test:mymeny>
But when I tries do that in a control a gets an error message like
"Literal content ('xyz') is not allowed within a
'ASP.thecontrol_ascx'". Is it possible to solve this problem?

PEK


Nov 19 '05 #2
I concur with this selection wholeheartedly.
Nikhil Kothari and Vandana Datye did a bangup job!

I have it on my "most-used bookshelf.

Here's the link to its MSPress page :

http://www.microsoft.com/MSPress/books/5728.asp

$37.79 at Amazon and $38.99 at Quantumbooks.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:88**********************@msnews.microsoft.com ...
The best resource I've found for helping build custom controls like this is "ASP.NET
Server Controls and Components". It goes into good detail showing how to design & build
controls (and how to apply the custom attributes) to get what you want.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know how to create and use user controls, by I find them sometimes
to limited. I sometimes want to creating something like this:

<test:mycontrol runat="server">
<p>Some text</p>
</test:mycontrol>
I also want to do something like this:

<test:mymenu runat="server">
<test:mymenuitem>Item 1</test:mymenuitem>
<test:mymenuitem>Item 2</test:mymenuitem>
<test:mymenuitem>Item 3</test:mymenuitem>
<test:mymenuitem>Item 4</test:mymenuitem>
</test:mymeny>
But when I tries do that in a control a gets an error message like
"Literal content ('xyz') is not allowed within a
'ASP.thecontrol_ascx'". Is it possible to solve this problem?

PEK


Nov 19 '05 #3
PEK
Thanks, I didn't know it was server controls I was searching for :-).
And the book seems to be interesting too.

PEK

Nov 19 '05 #4

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

Similar topics

10
by: BBM | last post by:
Hi, I have been developing with C# User Controls and occasionally have a problem where I "lose" a control from the design surface of the User Control. The controls that I am using to build my...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
1
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
3
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
1
by: zeya_bakhtyar | last post by:
Here is the page architecture: Page loads multiple user controls (including nested user controls) dynamically based on parameters provided into place holders. Note: The page only has the logic to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.