Professional Web Applications Themes

How to keep User Control from instantiating - ASP.NET General

It doesn't know what record to load from the database until the user select from a list. Also, it loads a boat load of data and I want to only load it when the user really needs it. Thanks for your quick reply BTW. Mike  [/ref] to  > >You can't. > >What's wrong with it instantiating at the normal time? >-- >John Saunders >Internet Engineer >com > > >. >[/ref]...

  1. #1

    Default Re: How to keep User Control from instantiating

    It doesn't know what record to load from the database
    until the user select from a list. Also, it loads a boat
    load of data and I want to only load it when the user
    really needs it.

    Thanks for your quick reply BTW.
    Mike
     [/ref]
    to 
    >
    >You can't.
    >
    >What's wrong with it instantiating at the normal time?
    >--
    >John Saunders
    >Internet Engineer
    >com
    >
    >
    >.
    >[/ref]
    Mike Guest

  2. #2

    Default Re: How to keep User Control from instantiating

    "Mike Fors" <platinumc.net> wrote in message
    news:077501c36c42$d29e0ac0$gbl... 

    So give the user control a LoadRecord(recordToLoad) method and call it when
    you know what to load.

    I hope you weren't loading the data in the constructor or in OnInit...
    --
    John Saunders
    Internet Engineer
    com


    John Guest

  3. #3

    Default Re: How to keep User Control from instantiating


    Thanks, that works great.
    How do I get a handle or assign a variable to the created
    object?

    Mike
     
    collected instead of 
    ("~/virdir/filename.ascx"); 
    page's html, for 
    collection is performed [/ref]
    boat [/ref][/ref]
    message [/ref][/ref]
    want [/ref]
    >
    >
    >.
    >[/ref]
    Mike Guest

Similar Threads

  1. user control problem access value from user control to a page
    By gauravkg via DotNetMonster.com in forum ASP.NET Building Controls
    Replies: 3
    Last Post: September 18th, 01:06 AM
  2. Control in User Control not instantiating
    By John Teague in forum ASP.NET Building Controls
    Replies: 5
    Last Post: March 21st, 02:35 PM
  3. Dynamically Adding User Control with Child User Control
    By Travis Pruitt in forum ASP.NET Building Controls
    Replies: 0
    Last Post: January 13th, 08:49 PM
  4. Replies: 5
    Last Post: February 24th, 02:07 PM
  5. Page Load fired 3 times Web user control is embedded in a custom control
    By Thomas Ekegren in forum ASP.NET Building Controls
    Replies: 0
    Last Post: September 3rd, 05:37 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