473,382 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

trouble calling a webmethod

hi

asp.net 2.0

The webmethod below don't get called. I'm not sure what I do wrong here. I
think it's something to with the parameters. The GetCompletionList takes 2
parameters. I don't set the value of these input parameters.

[WebMethod]
Car: <asp:TextBox ID="txtCar" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
TargetControlID="txtCar"
ServicePath="~/Services/AutoCompleteWebSite.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="3" CompletionSetCount="10" >
</cc1:AutoCompleteExtender>
public List<stringGetCompletionList(string prefix, int count)
{
List<stringcars = Car.GetCarsCollection(prefix, count);
List<stringnames = null;
foreach (Car car in cars)
{
names.Add(car.Url);
}
return names;
}

any suggestions why my code isn't executed
Nov 20 '08 #1
5 3987
The WebMethod must be declared as static...

George.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:eo**************@TK2MSFTNGP06.phx.gbl...
hi

asp.net 2.0

The webmethod below don't get called. I'm not sure what I do wrong here.
I think it's something to with the parameters. The GetCompletionList takes
2 parameters. I don't set the value of these input parameters.

[WebMethod]
Car: <asp:TextBox ID="txtCar" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
TargetControlID="txtCar"
ServicePath="~/Services/AutoCompleteWebSite.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="3" CompletionSetCount="10" >
</cc1:AutoCompleteExtender>
public List<stringGetCompletionList(string prefix, int count)
{
List<stringcars = Car.GetCarsCollection(prefix, count);
List<stringnames = null;
foreach (Car car in cars)
{
names.Add(car.Url);
}
return names;
}

any suggestions why my code isn't executed
Nov 20 '08 #2
you mean like this:

[WebMethod]
public static List<stringGetCompletionList(string prefix, int count)
{
List<stringcars = Car.GetCarsCollection(prefix, count);
List<stringnames = null;
foreach (Car car in cars)
{
names.Add(car.Url);
}
return names;
}

I've tryed this but the code didn't execute. I wonder if that is because I
haven't specified the values of the input parameters of the
GetCompletionList... not sure how to specify them


"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:eo**************@TK2MSFTNGP06.phx.gbl...
hi

asp.net 2.0

The webmethod below don't get called. I'm not sure what I do wrong here.
I think it's something to with the parameters. The GetCompletionList takes
2 parameters. I don't set the value of these input parameters.

[WebMethod]
Car: <asp:TextBox ID="txtCar" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
TargetControlID="txtCar"
ServicePath="~/Services/AutoCompleteWebSite.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="3" CompletionSetCount="10" >
</cc1:AutoCompleteExtender>
public List<stringGetCompletionList(string prefix, int count)
{
List<stringcars = Car.GetCarsCollection(prefix, count);
List<stringnames = null;
foreach (Car car in cars)
{
names.Add(car.Url);
}
return names;
}

any suggestions why my code isn't executed

Nov 20 '08 #3
I am sorry i did not notice that you using it as a Service and not WebMethod
on page.
Then it does not need to be static.

So you have in your project root file AutoCompleteWebSite.asmx where you
define this GetCompletionList function.

There is a video http://www.asp.net/learn/ajax-videos/video-122.aspx on how
to do it as well as C# code..
Check it out.
George.
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:Oe**************@TK2MSFTNGP04.phx.gbl...
you mean like this:

[WebMethod]
public static List<stringGetCompletionList(string prefix, int count)
{
List<stringcars = Car.GetCarsCollection(prefix, count);
List<stringnames = null;
foreach (Car car in cars)
{
names.Add(car.Url);
}
return names;
}

I've tryed this but the code didn't execute. I wonder if that is because I
haven't specified the values of the input parameters of the
GetCompletionList... not sure how to specify them


"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:eo**************@TK2MSFTNGP06.phx.gbl...
>hi

asp.net 2.0

The webmethod below don't get called. I'm not sure what I do wrong here.
I think it's something to with the parameters. The GetCompletionList
takes 2 parameters. I don't set the value of these input parameters.

[WebMethod]
Car: <asp:TextBox ID="txtCar" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
TargetControlID="txtCar"
ServicePath="~/Services/AutoCompleteWebSite.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="3" CompletionSetCount="10" >
</cc1:AutoCompleteExtender>
public List<stringGetCompletionList(string prefix, int count)
{
List<stringcars = Car.GetCarsCollection(prefix, count);
List<stringnames = null;
foreach (Car car in cars)
{
names.Add(car.Url);
}
return names;
}

any suggestions why my code isn't executed

Nov 20 '08 #4
Yeah I've been watching that video a few times already today. It is that
video I've based my code on. I still don't understand how he pass
paramerters to the GetCompletionList method. That method takes 2 parameters,
but I don't know where they are set.

any ideas how those parameters are specified?
Nov 20 '08 #5
They have a download C# right next to the video link
Just download the code

George.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:ew*************@TK2MSFTNGP06.phx.gbl...
Yeah I've been watching that video a few times already today. It is that
video I've based my code on. I still don't understand how he pass
paramerters to the GetCompletionList method. That method takes 2
parameters, but I don't know where they are set.

any ideas how those parameters are specified?
Nov 21 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Rob Kellow | last post by:
Hello, I'm working on an application for use within my company on our intranet that will be used to gather some information and store some of the info in a SQL Server database and the rest of the...
7
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is...
0
by: Kent | last post by:
Hi, I am trying to write my first web service. I have the following code: Imports System.Web.Services Public Class Service1 Inherits System.Web.Services.WebService Private _ErrorText As String...
5
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
0
by: cataztrophe | last post by:
I have an ASP.NET/VB.NET program. There is a webservice does processing in a separate project which does not return any values. The webservice is executed upon clicking the run button on a certain...
0
by: Paul Hadfield | last post by:
Hi, From reading various articles on scalability issues, I understand that there is only a finite number of ASP.NET worker threads and any long running task within ASP.NET should be fired off on...
0
by: BornTOCode | last post by:
Hello, I am attempting to call a (Delphi) win32 DLL from a Delphi.Net webservice. I am using a slightly modified version of the hello world webservice that comes with Delphi 2006. The DLL...
1
by: neerom | last post by:
Hi I need to call webservice from xslt in HTTP POST Method. The MSXML should be used. I am using javascript. I have an XML File which is having Integer Node.....Shown Below <?xml version="1.0"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.