Professional Web Applications Themes

Circular references are not supported - ASP.NET Building Controls

I have a user control, and I would like to create another instance of the user control inside the same user control. I am doing this because the user control has a datagrid, and in the datagrid I instantiate a reference to a new instance of the same ascx file that I am currently on and place it in the datagrid. I am recursing through records and only create a new instance if sub-records exist for the record I am currently on in the datagrid. What do you guys suggest as a workaround? I'd like to code it to allow ...

  1. #1

    Default Circular references are not supported

    I have a user control, and I would like to create another instance of the
    user control inside the same user control.

    I am doing this because the user control has a datagrid, and in the datagrid
    I instantiate a reference to a new instance of the same ascx file that I am
    currently on and place it in the datagrid. I am recursing through records
    and only create a new instance if sub-records exist for the record I am
    currently on in the datagrid.

    What do you guys suggest as a workaround? I'd like to code it to allow an
    unlimited amount of sub levels to be shown in the hierarchy.

    Any ideas on how to get around this issue ?

    Thanks,

    Dan



    Dan C Douglas Guest

  2. #2

    Default Circular references are not supported

    I have a user control, and I would like to create another instance of the
    user control inside the same user control.

    I am doing this because the user control has a datagrid, and in the datagrid
    I instantiate a reference to a new instance of the same ascx file that I am
    currently on and place it in the datagrid. I am recursing through records
    and only create a new instance if sub-records exist for the record I am
    currently on in the datagrid.

    What do you guys suggest as a workaround? I'd like to code it to allow an
    unlimited amount of sub levels to be shown in the hierarchy.

    Any ideas on how to get around this issue ?

    Thanks,

    Dan



    Dan C Douglas Guest

  3. #3

    Default Re: Circular references are not supported

    I'd suggest you create a custom control instead of a user control. They are
    more sophisticated (and complex) so they allow for more advanced features
    like you're trying to implement.
    Here's more info:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebUserControlsVsCustomWebControls.asp[/url]
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp[/url]
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontowebusercontrols.asp[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]
    Developer for Hire


    "Dan C Douglas" <nottellingnowhere.com> wrote in message
    news:uN8xs3dYDHA.4020tk2msftngp13.phx.gbl...
    > I have a user control, and I would like to create another instance of the
    > user control inside the same user control.
    >
    > I am doing this because the user control has a datagrid, and in the
    datagrid
    > I instantiate a reference to a new instance of the same ascx file that I
    am
    > currently on and place it in the datagrid. I am recursing through records
    > and only create a new instance if sub-records exist for the record I am
    > currently on in the datagrid.
    >
    > What do you guys suggest as a workaround? I'd like to code it to allow an
    > unlimited amount of sub levels to be shown in the hierarchy.
    >
    > Any ideas on how to get around this issue ?
    >
    > Thanks,
    >
    > Dan
    >
    >
    >

    Steve C. Orr, MCSD Guest

  4. #4

    Default Re: Circular references are not supported

    I'd suggest you create a custom control instead of a user control. They are
    more sophisticated (and complex) so they allow for more advanced features
    like you're trying to implement.
    Here's more info:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebUserControlsVsCustomWebControls.asp[/url]
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp[/url]
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontowebusercontrols.asp[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]
    Developer for Hire


    "Dan C Douglas" <nottellingnowhere.com> wrote in message
    news:uN8xs3dYDHA.4020tk2msftngp13.phx.gbl...
    > I have a user control, and I would like to create another instance of the
    > user control inside the same user control.
    >
    > I am doing this because the user control has a datagrid, and in the
    datagrid
    > I instantiate a reference to a new instance of the same ascx file that I
    am
    > currently on and place it in the datagrid. I am recursing through records
    > and only create a new instance if sub-records exist for the record I am
    > currently on in the datagrid.
    >
    > What do you guys suggest as a workaround? I'd like to code it to allow an
    > unlimited amount of sub levels to be shown in the hierarchy.
    >
    > Any ideas on how to get around this issue ?
    >
    > Thanks,
    >
    > Dan
    >
    >
    >

    Steve C. Orr, MCSD Guest

Similar Threads

  1. #39046 [NEW]: double free on circular references
    By checat at yandex dot ru in forum PHP Bugs
    Replies: 4
    Last Post: October 5th, 03:40 PM
  2. Quotes and circular references
    By JR in forum PERL Miscellaneous
    Replies: 3
    Last Post: September 9th, 04:26 PM
  3. circular use bug?
    By Jim Thomason in forum PERL Miscellaneous
    Replies: 2
    Last Post: September 3rd, 01:32 AM
  4. A question about Circular References
    By Scott Thompson in forum Ruby
    Replies: 4
    Last Post: August 12th, 02:36 PM
  5. circular border
    By Lisa in forum Macromedia Fireworks
    Replies: 1
    Last Post: July 11th, 06:54 PM

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