ASP.NET: Why can't I call a web-service twice in one page?

Posted by Shay on Stack Overflow See other posts from Stack Overflow or by Shay
Published on 2010-05-11T09:44:48Z Indexed on 2010/05/11 9:54 UTC
Read the original article Hit count: 258

Hi all! I built a web-application which calls a web-service twice in the application's log-in page - first, on Page_Load, and the second time is after a button click. When debugging, everything goes well, but after publishing the web-application and trying it - I cannot make the two calls for the web-service (each call is invoking a different function in the same web-service).

If I call it once (say, in the Page_Load) its OK, but once I get to the button click event, the page just seems to be loading but actually doing nothing (loading to infinity).

When I disabled the web-service call in Page_Load, the web-service call after the button click worked well, and if I switched between them (disabled the call in button click and enabled the call in Page_Load) the enabled one worked OK.

How come this is happening? What did I do wrong? Could it be related to the fact that the location where I published my web-application has some URL-rewriting rules?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about web-services