client-side javascript mixed with postback

Discussion in 'ASP .Net' started by rodchar, Nov 27, 2007.

  1. rodchar

    rodchar Guest

    hey all,
    imagine this for a moment if you will:
    i have a row in a gridview that when it is in edit mode there is a column
    that contains a dropdownlist and 2nd column that contains a user control. The
    user control is basically a date field. Itl has a button which toggles a
    calendar's visibility that is also inside the user control.

    in the rowdatabound event depending on the value that is bound to the
    dropdownlist i enable or disable the date user control.

    i have some client-side javascript for the onchange event of the
    dropdownlist which again depending on the value selected in the dropdownlist
    will disable or enable the date user control.

    let's say i go to edit a row in the gridview and the value in the
    dropdownlist causes the date user control to be disabled initially as a
    result of the rowdatabound event. ok, so i change the dropdownlist value to
    something that i know will enable it which will be done thru the onchange
    event and javascript as mentioned above. Everything is working fine to this
    point.

    now i understand there are ajax calendars out there that will solve this
    problem in a flash (or should i say in a silverlight) but this is one of my
    constraints having to use this existing date user control. the calendar
    button does a postback to toggle the calendar's visibility.

    so now i click the calendar button to display the calendar, can you guess
    what happens to the date user control? it immediately becomes disabled. can
    someone please tell me why this is (i have an idea...i'm guessing viewstate)
    and some workarounds.

    hope this is clear.

    thanks,
    rodchar
    rodchar, Nov 27, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam Martin
    Replies:
    1
    Views:
    683
    bruce barker
    Sep 15, 2004
  2. Boss302
    Replies:
    0
    Views:
    1,023
    Boss302
    Nov 21, 2006
  3. Bogdan
    Replies:
    2
    Views:
    639
    Bogdan
    Jun 9, 2008
  4. MAX2006
    Replies:
    7
    Views:
    3,445
    Steven Cheng
    Sep 17, 2008
  5. Zoe Hart
    Replies:
    1
    Views:
    354
    Scott Wisniewski
    Jan 8, 2004
Loading...

Share This Page