473,795 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:mycontr ol runat="server">
<p>Some text</p>
</test:mycontrol>

I also want to do something like this:

<test:mymenu runat="server">
<test:mymenuite m>Item 1</test:mymenuitem >
<test:mymenuite m>Item 2</test:mymenuitem >
<test:mymenuite m>Item 3</test:mymenuitem >
<test:mymenuite m>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 1016
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:mycontr ol runat="server">
<p>Some text</p>
</test:mycontrol>
I also want to do something like this:

<test:mymenu runat="server">
<test:mymenuite m>Item 1</test:mymenuitem >
<test:mymenuite m>Item 2</test:mymenuitem >
<test:mymenuite m>Item 3</test:mymenuitem >
<test:mymenuite m>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****@NOSPAMd evelop.com> wrote in message
news:88******** **************@ msnews.microsof t.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:mycontr ol runat="server">
<p>Some text</p>
</test:mycontrol>
I also want to do something like this:

<test:mymenu runat="server">
<test:mymenuite m>Item 1</test:mymenuitem >
<test:mymenuite m>Item 2</test:mymenuitem >
<test:mymenuite m>Item 3</test:mymenuitem >
<test:mymenuite m>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
2705
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 User Controls are themselves custom controls. Occasionally, when I change something in either the User Control and/or one of the custom controls that are on it and recompile, when I go to the "Visual" design surface of the User Control, the...
1
7588
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 dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
1
2137
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 to programming, but I am new to ASP.NET and Web application design in general... loved the concept of user controls and dynamically adding them to a page. So what I wound up with was an application that dynamically loads two user controls directly...
6
3383
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 the usual stuff of recreating the usercontrol in the Page Init event. The 'failure' sequence is as follows: - select web form button to display the user control - select user control button, event fires - select web form button to display...
4
1942
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 some reason I keep getting the error: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
2
1985
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 some reason I keep getting the error: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
0
1936
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 some reason I keep getting the error: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
3
2238
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 some reason I keep getting the error: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
2
15074
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 been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am trying to do is to create a postback-free web application through the use of ASP.net AJAX UpdatePanels...
1
4746
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 load the user controls and subscribe to custom event exposed in the user controls. Scenario: User comes to this page fills the fields generated by multiple user controls and then hits "Save" button in one of the forms.
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.