1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
   |  
<asp:TextBox ID="TextBoxPointRemarquable" runat="server" autocomplete="off" SkinID="skinLibelleLong" ToolTip="<%$ Resources:POINT_REMARQUABLE_TOOLTIP %>"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtenderPointRemarquable"
            runat="server"
            BehaviorID="AutoCompleteEx"
            TargetControlID="TextBoxPointRemarquable" 
            ServiceMethod="GetListePointRemarquable" 
            ServicePath="~/WebServices/PointRemarquableWS.asmx"
            CompletionInterval="20"
            MinimumPrefixLength="2" 
            EnableCaching="true"
            CompletionSetCount="12" 
            UseContextKey="True" SkinID="green" 
            OnClientItemSelected="AutoCompleteExtenderPointRemarquable_ClientItemSelected">
            <Animations>
                <OnShow>
                    <Sequence>
 
                        <OpacityAction Opacity="0" />
                        <HideAction Visible="true" />
 
 
                        <ScriptAction Script="
                            // Cache the size and setup the initial size
                            var behavior = $find('AutoCompleteEx');
                            if (!behavior._height) {
                                var target = behavior.get_completionList();
                                behavior._height = target.offsetHeight - 2;
                                target.style.height = '0px';
                            }" />
 
 
                        <Parallel Duration=".4">
                            <FadeIn />
                            <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
                        </Parallel>
                    </Sequence>
                </OnShow>
                <OnHide>
 
                    <Parallel Duration=".4">
                        <FadeOut />
                        <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
                    </Parallel>
                </OnHide></Animations>
 
    </ajaxToolkit:AutoCompleteExtender>
<script type="text/javascript">
 
    $addHandler($get('<%=TextBoxPointRemarquable.ClientID%>'), 'keypress', function(){
        $get('<%=HiddenFieldIdPointRemarquable.ClientID %>').value = '';
        alert(GetBehaviorID());
    }); 
 
    $addHandler($get('<%=TextBoxPointRemarquable.ClientID%>'), 'keydown', function(sender, e){
        var keycode;
        if (window.event) keycode = window.event.keyCode;
        else if (e) keycode = e.which;
        if (keycode != 13 && keycode != 9)
        {
            $get('<%=HiddenFieldIdPointRemarquable.ClientID %>').value = '';
        }
    }); 
 
    var AutoCompleteExtenderPointRemarquable_ClientItemSelected = function(sender, e){
        $get('<%=HiddenFieldIdPointRemarquable.ClientID %>').value = e.get_value(); 
    }
 
</script>
 
<asp:HiddenField ID="HiddenFieldIdPointRemarquable" runat="server" /> | 
Partager