interesting ajax issue

Discussion in 'ASP .Net' started by Guest, Aug 1, 2007.

  1. Guest

    Guest Guest

    Hi all,

    I have an interesting issue that I think maybe related to AJAX. Here is my
    scenario:-

    I have an aspx page that contains an UpdatePanel with
    UpdateMode="conditional". There exists 2 usercontrols (ascx) inside this
    main UpdatePanel called UserControlA & UserControlB. Additionally, there is
    also a submit button inside this main UpdatePanel called BTNSUBMIT.

    Both UserControlA and UserControlB be in turn have an UpdatePanel inside
    their content with the default value for UpdateMode. UserControlA has a
    read-only textbox called TextBox1 and a checkbox called CheckBox1 inside its
    UpdatePanel. When the user clicks on the checkbox, some client-side
    javascript is invoked that changes the value of the read-only textbox. This
    works fine client-side.

    However, when the user clicks on BTNSUBMIT (which resides in the parent aspx
    page) as postback occurs and the value sent back to the server for TextBox1
    is the original value and not the new value changed by the javascript code.

    Any ideas?

    TIA!
     
    Guest, Aug 1, 2007
    #1
    1. Advertising

  2. Guest

    bruce barker Guest

    the Textbox will not load the postback value if its readonly. your code
    can read it manually from the from postback values or (i haven't tested
    but should work), turn viewstate off, and in oninit set readonly false.
    set it back on in prerender.

    -- bruce (sqlwork.com)


    am wrote:
    > Hi all,
    >
    > I have an interesting issue that I think maybe related to AJAX. Here is my
    > scenario:-
    >
    > I have an aspx page that contains an UpdatePanel with
    > UpdateMode="conditional". There exists 2 usercontrols (ascx) inside this
    > main UpdatePanel called UserControlA & UserControlB. Additionally, there is
    > also a submit button inside this main UpdatePanel called BTNSUBMIT.
    >
    > Both UserControlA and UserControlB be in turn have an UpdatePanel inside
    > their content with the default value for UpdateMode. UserControlA has a
    > read-only textbox called TextBox1 and a checkbox called CheckBox1 inside its
    > UpdatePanel. When the user clicks on the checkbox, some client-side
    > javascript is invoked that changes the value of the read-only textbox. This
    > works fine client-side.
    >
    > However, when the user clicks on BTNSUBMIT (which resides in the parent aspx
    > page) as postback occurs and the value sent back to the server for TextBox1
    > is the original value and not the new value changed by the javascript code.
    >
    > Any ideas?
    >
    > TIA!
    >
    >
     
    bruce barker, Aug 1, 2007
    #2
    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. Jeffrey Maitland
    Replies:
    0
    Views:
    283
    Jeffrey Maitland
    Jun 29, 2005
  2. Captain
    Replies:
    2
    Views:
    519
    Captain
    Oct 10, 2006
  3. minnie
    Replies:
    1
    Views:
    727
    Andrew Thompson
    Dec 13, 2006
  4. Mike

    Simple but interesting issue

    Mike, Mar 16, 2007, in forum: C Programming
    Replies:
    9
    Views:
    352
    Keith Thompson
    Mar 16, 2007
  5. Jay
    Replies:
    2
    Views:
    152
    Bart Van der Donck
    Oct 15, 2007
Loading...

Share This Page