将参数传递给Web服务方法 [英] Pass parameter to Web service method
问题描述
你好,
我创建了自动完成"文本框,其中显示了特定部门的EmployeeId.
但是我给选项用户从DropDown中选择Department.我想将此选定的值传递给具有自动完成代码的Web服务.
以下是我的aspx页面中的代码:
hello,
I have created Autocomplete text box which shows EmployeeIds of perticular department.
However I am giving option user to select Department from DropDown. i want to pass this selected value to web service that has code for autocomplete.
Following is code in my aspx page:
<asp:TextBox ID="tbEmployeeID" runat="server" CssClass="textBox"></asp:TextBox>
<act:AutoCompleteExtender ID="tbEmployeeID_AutoCompleteExtender" runat="server" ServicePath="~/EmployeeIDs.asmx" ServiceMethod="GetCompletionList" TargetControlID="tbEmployeeID" MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="10" ShowOnlyCurrentWordInCompletionListItem="true">
</act:AutoCompleteExtender>
如何将参数传递给Webservice?
我什至尝试从代码隐藏文件中使用会话..但是我得到一个错误,我的网络服务说"Object reference not set to an instance of an object.
".
我该怎么办..
请帮帮我
谢谢
How can I pass parameter to webservice?
I even tried using Sessions from codebehind file.. but I got error I webservice saying "Object reference not set to an instance of an object.
".
How can I do this..
Please help me
Thank you
推荐答案
检查这些博客
http://social.msdn.microsoft.com /Forums/zh-CN/webgadgetdevelopment/thread/176a7f0c-8b9f-4bb2-bda8-e5fb6ae82b6e/ [ http://midnightprogrammer.net/post/Calling-ASPNET-Web- Service-Using-Jquery-Part-II.aspx [ ^ ]
--NDK
check these blogs
http://social.msdn.microsoft.com/Forums/en-US/webgadgetdevelopment/thread/176a7f0c-8b9f-4bb2-bda8-e5fb6ae82b6e/[^]
http://midnightprogrammer.net/post/Calling-ASPNET-Web-Service-Using-Jquery-Part-II.aspx[^]
--NDK
您可以将ContextKey
用作UseContextKey="True" ContextKey="<your department>"
You may use theContextKey
asUseContextKey="True" ContextKey="<your department>"
Public Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String()
'Use contextKey in your query
这篇关于将参数传递给Web服务方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!