title: Twilio click to call
body: <p>I'm trying to make a page that will allow users to click a button in a browser so they can make a call to a phone number in our office. When I debug the code it all runs fine but when I click the button on the page nothing happens. I don't see any errors in the developer tools either.  </p>
  
  <pre><code>&lt;button class="btn btn-danger btn-large" runat="server" onclick="callpage_Click" style="margin-left:95px"&gt;&lt;i class="icon-phone"&gt;&lt;/i&gt; Call us!&lt;/button&gt;
  
  
  
  protected void callpage_Click(object sender, EventArgs e)
          { // Find your Account Sid and Auth Token at twilio.com/user/account 
              string AccountSid = "************";
              string AuthToken = "************";
              var twilio = new TwilioRestClient(AccountSid, AuthToken);
  
  
      // Build the parameters 
      CallOptions options = new CallOptions();
      options.To = "+**********";
      options.From = "+*************";
      options.Url = "http://demo.twilio.com/docs/voice.xml";
      options.ApplicationSid = "*****************";
      options.Method = "GET";
      options.FallbackMethod = "GET";
      options.StatusCallbackMethod = "GET";
      options.Record = false;
  
      var call = twilio.InitiateOutboundCall(options);
      Console.WriteLine(call.Sid);
      if (call.RestException == null)
      {
          Response.Write(string.Format("Started call: {0}", call.Sid));
      }
      else
      {
          Response.Write(string.Format("Error: {0}", call.RestException.Message));
      }
  }
  </code></pre>