views:

9

answers:

1

Morning - I'm having a little problem.

I have an autocomplete extender textbox where a user types in words and suggestions are provide. Should the term be rather generic, a list appears and the user can scroll up or down using the mouse wheel with no problems at all.

However, if the user attempts to click on the scroll bar and scroll through the list, it fires the textchanged event - which I don't want it to do.

This event should only fire once the user has actually selected the appropriate product from the list supplied.

I can set the autopost back of the text file off which has the desired effect but I do require the post back to be performed once the user selects a suggestion.

Does anyone know how I can get around this?

A: 

I managed to find a resolution.

Stick this in the page load event:

string contactPostBackFunction = null;

            contactPostBackFunction = Page.ClientScript.GetPostBackEventReference(this.tbxProdAC, "", false);

            string contactPostBackScript = null;

            contactPostBackScript = string.Format("function postBackOnContactSelectedFromDropDown() {0} {1} {2}", "{", contactPostBackFunction, "}");

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "contactPostBackScript", contactPostBackScript, true);

And have this in your Autocomplete extender properties:

OnClientItemSelected="postBackOnContactSelectedFromDropDown"
Ricardo Deano