Post-back using Javascript

G

Garg

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???
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top