Post-back using Javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Garg

    #1

    Post-back using Javascript

    I had a listbox, whose autoPostBAck property was set to true. So. if
    I was clicking on any item for the first time, it caused a successful
    post-back. However, if i clicked on the item subsequently, no post-
    back occured (because the index of the selected item did not change,
    hence the click event was not captured).

    So, to capture the click event everytime, i added a _dopostback
    function in javascript code. This made post-back possible for
    subsequent clicks on the same list-item.

    But i get a problem because of this. Now when I click on a list-item
    first time, post-back occurs twice:
    -- Once because of javascript function (_dopostback)
    -- Secondly, because of autoPostBack property of list-box set to true.

    However, on second click, there occurs only one post-back because of
    javascript only. Thats wat I require. Wat i dont require is two post-
    backs on first click!!!

    Pls tell me how do I prevent javascript function from working on first
    click of the list-item???

  • Newbie Coder

    #2
    Re: Post-back using Javascript

    Garg,

    Ask this in:

    microsoft.publi c.dotnet.framew ork.aspnet

    --
    Newbie Coder
    (It's just a name)




    "Garg" <shivanigarg4@g mail.comwrote in message
    news:1179922037 .872342.307340@ u30g2000hsc.goo glegroups.com.. .
    I had a listbox, whose autoPostBAck property was set to true. So. if
    I was clicking on any item for the first time, it caused a successful
    post-back. However, if i clicked on the item subsequently, no post-
    back occured (because the index of the selected item did not change,
    hence the click event was not captured).
    >
    So, to capture the click event everytime, i added a _dopostback
    function in javascript code. This made post-back possible for
    subsequent clicks on the same list-item.
    >
    But i get a problem because of this. Now when I click on a list-item
    first time, post-back occurs twice:
    -- Once because of javascript function (_dopostback)
    -- Secondly, because of autoPostBack property of list-box set to true.
    >
    However, on second click, there occurs only one post-back because of
    javascript only. Thats wat I require. Wat i dont require is two post-
    backs on first click!!!
    >
    Pls tell me how do I prevent javascript function from working on first
    click of the list-item???
    >

    Comment

    Working...