title: ASP.NET: Why can't I call a web-service twice in one page?
body: <p>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).</p>
  
  <p>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).</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <hr>
  
  <p>I don't use (!isPostBack) - I did try to put both calls after the button click event though, and still had the same problem.</p>
  
  <p>Relevant parts of the code:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      MyService.Functions service = new MyService.Functions();
      string str = service.DigestURL(Request.RawUrl.ToString());
      ...
  }
  
  
  public void submitButton_Click(object sender, ImageClickEventArgs e)
  {
      MyService.Functions service = new MyService.Functions();
      string str = service.CommitLogIn(usernameText.Text, passwordText.Text);
      ...
  }
  </code></pre>