.net ajax500错误,c# - Asp.Net Ajax WebService and Internal Error 500 - Stack Overflow

I can call the webservie directly to the browser with the following URL and it returns be all what I want :

http://localhost:64438/MySearchAutoComplete.asmx/GetCompletionList

When I add it to an autocompleteexetender into the Default.aspx page like that :

TargetControlID="TextBox1"

runat="server"

ServiceMethod="GetCompletionList"

ServicePath="http://localhost:64438/MySearchAutoComplete.asmx"

CompletionSetCount="12"

MinimumPrefixLength="1" />

The page load, I have a textbox but I have an error 500 every time I add a keystroke in the textbox. I see the error in the FireFox FireBug.

http://localhost:62702/ --->This is the webpage that load fine

WMS23.png

--> This is the error

Any idea? I have noticed that I need to attach the process to debug the webservice, I might do something wrong with it too?

Edit (Event Viewer)

If I go to the Event Viewer of my machine. I can see :

Exception information:

Exception type: InvalidOperationException

Exception message: Request format is unrecognized for URL unexpectedly ending in '/GetCompletionList'.

Thread information:

Thread ID: 8

Thread account name: MTL\daok

Is impersonating: False

Stack trace: at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)

at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)

at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)

at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I also have to start the webservice project first, than I stop it and start the webproject to be able to have both. The webservice still works (I can fire it directly http://localhost:64438/MySearchAutoComplete.asmx?op=GetCompletionList) but on the webpage I still have that Error 500.

Edit 2 (Web.config)

Adding to the webservice project web.config:

Have not solve the problem.

Edit 3 (Direct call)

Calling in the Page_Load() the same method from the WebService work very well:

string[] stuffs;

stuffs = proxy.GetCompletionList("1", 10);

MyList.DataSource = stuffs;

MyList.DataBind();

But it's not working with the AutoCompleteExtender...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值