Results 1 to 4 of 4

Thread: Dropdownlist generates javascript error on postback

  1. #1

    Thread Starter
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306

    Question Dropdownlist generates javascript error on postback

    Hi All:

    autopostback on a dropdownlist is set to true. when I select an item from the list I get a javascript error 'object expected'

    From what I can see, it appears it cant find itself...

    anyone? tis driving me nuts

    this is the line it breaks on:

    Code:
    <select name="_ctl0:Makes" onchange="__doPostBack('_ctl0$Makes','')" language="javascript" id="_ctl0_Makes" class="dropdownlist1">

  2. #2

    Thread Starter
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    btw, the dropdownlist in question is on a usercontrol.

    just tried to create a new usercontrol with new list etc in case I'd buggered it somehow, anyway, same error.

    I then created a dropdownlist on an aspx with autopostback set to true, it works ... so whats the problem with putting controls with autopostback=true on a usercontrol?


  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Check to if the viewstate on the usercontrol is set to true. And make sure you are not using output caching on the user control.

  4. #4

    Thread Starter
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306

    Talking *resolved*

    the <form runat=server> tag should be on the aspx not inside the ascx

    I wont delete this thread, just in-case some other poor soul falls into this trap

Posting Permissions

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



Click Here to Expand Forum to Full Width