Professional Web Applications Themes

simple User Control ASCX - ASP.NET Building Controls

Hi all, I built an ASCX file (control) that hits my database, gets all state abbrevs, from the database or Cache if available. That works fine, but it doesn't seem to remember state and I can't gain access to the actual user control, via it's name in my code behind file--says it is not declared. Any ideas? Thanks Shane...

  1. #1

    Default simple User Control ASCX

    Hi all,

    I built an ASCX file (control) that hits my database, gets all state
    abbrevs, from the database or Cache if available.

    That works fine, but it doesn't seem to remember state and I can't gain
    access to the actual user control, via it's name in my code behind
    file--says it is not declared.

    Any ideas?

    Thanks

    Shane


    SStory Guest

  2. #2

    Default Re: simple User Control ASCX

    "SStory >" <Shane_Storyonline.msn.com <remove the 'online.' to send me
    mail> wrote in message news:OWAMC9tXDHA.536TK2MSFTNGP10.phx.gbl...
    ....
    > myParam = cmdAddRepAvailLoc.Parameters.Add("State", SqlDbType.Char)
    > myParam.Value = StatesAddLoc.SelectedItemText 'this is the line it errors
    > on
    >
    > Value is set to an property of the user control that returns the
    > selecteditems text
    >
    > What gives here?
    NullReferenceException means that a variable isn't set to anything (i.e.,
    it's set to "Nothing"). I'd bet that "StatesAddLoc" is that variable.

    I see you're using VB. Is Option Strict set to "On"?
    --
    John Saunders
    Internet Engineer
    [email]john.saunderssurfcontrol.com[/email]


    John Saunders Guest

  3. #3

    Default Re: simple User Control ASCX

    Haven't gotten debugger installed correctly.

    I have IIS on a separate machine with v 1.1 .net runtime installed.

    What do I need to do to get debugger working. It says.

    Error while trying to run project. Unable to start debugging on the web
    server. The debugger is not properly installed. Run setup to install or
    repair the debugger.

    What do I need to do.

    Do I run setup on the other machine and say install remote components or
    what?


    "John Saunders" <john.saunderssurfcontrol.com> wrote in message
    news:OwWYAADYDHA.1480tk2msftngp13.phx.gbl...
    > "SStory >" <Shane_Storyonline.msn.com <remove the 'online.' to send me
    > mail> wrote in message news:ucjpX6AYDHA.1900TK2MSFTNGP10.phx.gbl...
    > > 'State parameter definition
    > > myParam = cmdAddRepAvailLoc.Parameters.Add("State", SqlDbType.Char, 2)
    > > myParam.Value = StatesAddLoc.SelectedItemText
    > > 'the ERROR occurs here
    > >
    > > What could be going wrong?
    >
    > Either StatesAddLoc is Nothing or StatesAddLoc.SelectedItemText is
    Nothing.
    > Check to see which one. If it's
    >
    > SelectedItemText, look into its components.
    >
    > Basically, I'd set a breakpoint and look at things in the debugger.
    > --
    > John Saunders
    > Internet Engineer
    > [email]john.saunderssurfcontrol.com[/email]
    >
    >

    SStory Guest

  4. #4

    Default Re: simple User Control ASCX

    "SStory >" <Shane_Storyonline.msn.com <remove the 'online.' to send me
    mail> wrote in message news:%23GqHQKFYDHA.2308TK2MSFTNGP12.phx.gbl...
    > Haven't gotten debugger installed correctly.
    >
    > I have IIS on a separate machine with v 1.1 .net runtime installed.
    >
    > What do I need to do to get debugger working. It says.
    I'm afraid I've never had that problem, so I don't know how to fix it. We
    always run IIS on each developer's workstation (and just make sure it stays
    up to date).

    You might want to post in .framework.aspnet with a subject indicating your
    problem, or do an MSDN and/or Google search on the error message you're
    getting. There must be doenation in VS.NET on how to set up debugging.
    --
    John Saunders
    Internet Engineer
    [email]john.saunderssurfcontrol.com[/email]



    John Saunders Guest

Similar Threads

  1. Loading ascx file in user control
    By Ron in forum ASP.NET Building Controls
    Replies: 0
    Last Post: February 24th, 02:39 PM
  2. Best Practices: Porting ASCX control to compiled Custom Control?
    By David Bowey in forum ASP.NET Building Controls
    Replies: 1
    Last Post: March 16th, 01:33 AM
  3. Programatically created controls in an ascx user control misbehaving
    By Gary Graham in forum ASP.NET Building Controls
    Replies: 3
    Last Post: June 3rd, 09:59 PM
  4. Replies: 2
    Last Post: November 26th, 05:08 AM
  5. Can client-side script be included in a user control (ascx)?
    By msdn@SoftwareIntensive.com in forum ASP.NET Building Controls
    Replies: 2
    Last Post: November 17th, 02:29 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