本文介绍了AJAX C#AutoCompleteExtender contextKey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你如何动态传递参数/控制contextKey?

How do you dynamically pass parameter/control to contextKey?

<asp:TextBox ID="tbA" runat="server" autocomplete="off"></asp:TextBox> 
<asp:TextBox ID="tbB" runat="server">hello</asp:TextBox> 
<asp:TextBox ID="tbC" runat="server">world</asp:TextBox>

<cc1:AutoCompleteExtender ID="aceListA" ServiceMethod="myListServiceA" ServicePath="WebService.asmx" TargetControlID="tbA" runat="server" EnableCaching="true" UseContextKey="true"> </cc1:AutoCompleteExtender>

  [WebMethod]
   public string[] myListServiceA(string prefixText, int count, string contextKey)

由于我要检查TBB,TBC在Web服务水平。我读过这文章像5倍,但仍没有按'T作出感出来,每半失踪完整的codeS。

Because I want to check tbB, tbC at Web Service level.I've read this article like 5 times, but still doesn't make a sense out of it, per half missing complete codes.

推荐答案

您可以设置背景下的关键在两个方面:

You can set the context key in two ways:

客户端,通过JavaScript:    

Client-Side, through Javascript:

<script type="text/javascript">
    function SetContextKey()
    {
        $find('auJobs').set_contextKey('moo');
        return;
    }

</script>  `

或在服务器端auJobs.ContextKey =无论你需要摆在这里

oron the server sideauJobs.ContextKey = "Whatever You need to put in here"

特里

这篇关于AJAX C#AutoCompleteExtender contextKey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 13:41