title: Not able to use Microsoft translator after having clientID and client secret
body: <p>I have registered successfully on windows azure market place and I have a clientID and client secret, but I don't know how to use them in aspx page to translate a textbox text in desired language. I have this code but I don't know how to use it.
  Should I write the below code in webservice??? If yes then on writing in webservice , it is reflecting error in <code>AdmAccessToken</code> and <code>AdmAccessToken</code> </p>
  
  <pre><code> [System.Web.Services.WebMethod]
      public static AdmAccessToken GetAccessToken()
      {
          AdmAccessToken admToken;
          string headerValue;
          //Get Client Id and Client Secret from https://datamarket.azure.com/developer/applications/
          AdmAuthentication admAuth = new AdmAuthentication("clientid", "clientsecret");
  
          admToken = admAuth.GetAccessToken();
          // Create a header with the access_token property of the returned token
          headerValue = "Bearer" + " " + HttpUtility.UrlEncode(admToken.access_token);
  
          return admToken;
      } 
  </code></pre>
  
  <p>This is the code on page</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          var languageFrom = "en";
          var languageTo = "de";
          var text = "Use pixels to express measurements for padding and margins.";
          function translate() {
              PageMethods.GetAccessToken(OnSucceeded, OnFailed);
  
          }
          function OnSucceeded(result, usercontext, methodName) {
  
              window.mycallback = function (response) {
                  document.getElementById('&lt;%= lblResult.ClientID %&gt;').innerHTML = "Translation for &lt;br /&gt;source text: '" + text + "'&lt;br /&gt; from en to de &lt;br /&gt; " + response;
              }
  
              var s = document.createElement("script");
              s.src = "http://api.microsofttranslator.com/V2/Ajax.svc/Translate?oncomplete=mycallback&amp;appId=Bearer " + encodeURIComponent(result.access_token) + "&amp;from=" + languageFrom + "&amp;to=" + languageTo + "&amp;text=" + text;
              document.getElementsByTagName("head")[0].appendChild(s);
          }
          function OnFailed(error, userContext, methodName) {
              alert("Error");
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &lt;asp:ScriptManager ID="ScriptManager" runat="server" EnablePageMethods="true" /&gt;
          &lt;asp:Button ID="buttonTranslate" runat="server" Text="Translate" OnClientClick="translate();return false;" /&gt;
          &lt;br /&gt;
          &lt;asp:Label ID="lblResult" runat="server"&gt;&lt;/asp:Label&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help somebody so that I can translate my textbox text in any other language.</p>