Professional Web Applications Themes

Control with no closing tag - ASP.NET Building Controls

Hi, I'm trying to build a custom control that doesn't have a closing tag. For example, right now when I create a control from the IDE I get this: <cc1:MyControl runat="server" ID="SomeId"></cc1:MyControl> I'd like it to be: <cc1:MyControl runat="server" ID="SomeId" /> This control won't have any content, so I'm trying to make the definition shorter. I know it can be done because ImageButton does this; the question is how? Thanks....

  1. #1

    Default Control with no closing tag

    Hi,

    I'm trying to build a custom control that doesn't have a closing tag. For
    example, right now when I create a control from the IDE I get this:

    <cc1:MyControl runat="server" ID="SomeId"></cc1:MyControl>

    I'd like it to be:

    <cc1:MyControl runat="server" ID="SomeId" />

    This control won't have any content, so I'm trying to make the definition
    shorter. I know it can be done because ImageButton does this; the question
    is how?

    Thanks.


    Peter Guest

  2. #2

    Default RE: Control with no closing tag

    I think I had seen that adding [PChildren(false)] at the top of my class
    (for C#) <PChildren(false)> iirc for vb gave this behavior.
    Sadly I can seem to no longer drag and drop user controls from libraries
    since SP1 for visual 2005.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuipchildrenattributeclasstopic.a sp

    "Peter Zolja" wrote:
     
    Nathaniel Guest

  3. #3

    Default Re: Control with no closing tag

    >I think I had seen that adding [PChildren(false)] at the top of my 

    That was one of the things I tried before posting, but it doesn't seem to
    work. We had some issues with VS too; what we did was to slipstream the SP1
    into the kit and reinstall the whole thing. Surprisingly (or maybe not) it
    took less to do the slipstream, uninstall, and then reinstall the new
    version than simply installing SP1 on top. I hope you get it working...


    Peter Guest

Similar Threads

  1. How to write a control that doesn't require a closing tag
    By paul.hester@gmail.com in forum ASP.NET Building Controls
    Replies: 6
    Last Post: September 24th, 06:10 AM
  2. Refresh tree control without closing? HELP
    By clint317 in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: January 6th, 05:45 PM
  3. Replies: 6
    Last Post: February 17th, 02:30 PM
  4. Movie Closing?? & Windows Closing??
    By JPrice in forum Macromedia Director Lingo
    Replies: 0
    Last Post: July 29th, 01:17 AM
  5. Replies: 2
    Last Post: July 2nd, 08:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139