CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 10/31/2003 4:05:04 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 5 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
kblakeley
Asp.Net User
I know this is simple, but I can't get it to work....10/31/2003 4:05:04 PM

0/0

I am just starting to play around with creating server controls and I want to do something similiar to the panel control. I want my control to output a Div tag and then based on the contents of what is put between the tags of my server control, I want to render that content in between my div. I want to allow people to put straight HTML or use any server control. So something like this:

<cc1:CtrlTest id="CtrlTest1" runat="server">
<ASP:BUTTON Runat="server" Text="test"></ASP:BUTTON>
</cc1:CtrlTest>

I have been through a number of samples on MSDN and other sites and everything I have tried doesn't work quite the way I want.

Any help would be great.
Thanks
Kevin
joteke
Asp.Net User
Re: I know this is simple, but I can't get it to work....11/2/2003 9:25:02 AM

0/0

Hi,

first off, current built-in Panel control (<asp:panel runat="server" /> ) in ASP.NET already works this way.

However, to get same functionality for custom server control, there's two things to note:

1. If you derive from System.Web.UI.WebControls.WebControl you'd need to specify the control with specific ParseChildren(false) and PersistChildren(true) attributes. ParseChildren(false) causes that page parser parses the content between control's tags as child controls and adds them to the Control collection of the control. This way control can have nested child controls in declarative model as well. PersistChildren(true) is for visual designer so that it persists stuff as child controls (inner content for the control).

2. If you derive from System.Web.UI.Control, things are already working this way(content is mapped as child controls)
Thanks,

Teemu Keiski
Finland, EU
2 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

ng.novell-forums.novell-support-open-enterprise-server-linux-printing ... object not found errors in "client events log" and crashing iprin t. 3. 0. 6/19/2007 12:57:45 PM ... i know this is simple, but i can't get it to work...
UpdatePanel & ScriptManager Problem - asp.net_ajax.asp.net_ajax_ui ... how to logg changes in groupwise passwords. problem 39 in gwcheck. re: ... I can?t find a solution and trying me crazy because I getting no errors and ...
Anne M. - ""You know how I feel, Oh, freedom is mine, And I know how I ... Are fleets and armies necessary to a work of love and reconciliation? ... Taz T. ( 39) Manfred D. ( 17) View all: 349 friends. Anne's Recent Contributions ...
Whatever: Writing Tips for Non-Writers Who Don't Want to Work at Writing Simple. 1. Punctuate, damn you: For God's sake, is it really so hard to know where to put a comma? ... Frankly, I think if most non-writers can manage to get ...
Book Trailers: RSS - When "Simple Syndication" ISN'T "Really" They can put the word "simple" in it, but it doesn't make it any easier to use. ... You should know that if your RSS feed didn't work for some reason it could be an ...
complex law, simple code (Lessig Blog) Though this is creative work, and one can license the copyright part of it using ... April 7, 2003 3:39 PM t: t. April 7, 2003 3:39 PM t: t. January 21, 2004 2: ...
Don&#39;t Become Job-solete Your superiors should know that you always pitch in, are ready to help, and ... These steps may be simple, but each is an investment in that valuable commodity ...
Democrats wouldn&#39;t pull all troops out of Iraq | share.mcclatchydc.com ... war over.But most of them don't really believe it should be that neat and simple. ... Most people just don't want to know the true. ...
MySpace.com - [ m i s s i n c a n d e s c e n t ] - 39 - Female - Texas ... I am pale and work hard to keep it that way. I am a proud Twilighter. ... I don't know if I can do this. I told myself I can't be vulnerable to you again, y'know? ...
MySpace.com - -=Amy=- I know something you don't know =P - 18 - Female ... MySpace profile for -=Amy=- I know something you don&#39;t know =P with pictures, videos, personal blog, interests, information about me and more



 
All Times Are GMT