title: ASP.NET MVC 2 - Failed with jquery ajax response
body: <p>I do not understand this error, do not generate error in "JsonResult Test ()", I am doing other projects as ASP.NET MVC</p>
  
  <p>Thanks</p>
  
  <p>Error:</p>
  
  <pre><code>System.InvalidOperationException: This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
  
  [InvalidOperationException: This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.]
     System.Web.Mvc.JsonResult.ExecuteResult(ControllerContext context) +263733
     System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +10
     System.Web.Mvc.&lt;&gt;c__DisplayClass14.&lt;InvokeActionResultWithFilters&gt;b__11() +20
     System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +251
     System.Web.Mvc.&lt;&gt;c__DisplayClass16.&lt;InvokeActionResultWithFilters&gt;b__13() +19
     System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +178
     System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +314
     System.Web.Mvc.Controller.ExecuteCore() +105
     System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +39
     System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
     System.Web.Mvc.&lt;&gt;c__DisplayClass8.&lt;BeginProcessRequest&gt;b__4() +34
     System.Web.Mvc.Async.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0() +21
     System.Web.Mvc.Async.&lt;&gt;c__DisplayClass8`1.&lt;BeginSynchronous&gt;b__7(IAsyncResult _) +12
     System.Web.Mvc.Async.WrappedAsyncResult`1.End() +59
     System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +44
     System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +7
     System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8678910
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155
  </code></pre>
  
  <p>c#</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  
  namespace Tesis.Controllers
  {
      public class AnalysisSourceDataController : Controller
      {
          //
          // GET: /AnalysisSourceData/
  
          public ActionResult Index()
          {
              return View();
          }
  
          public JsonResult Test()
          {
              return Json(new { mymsg = "my msg" });
          }
      }
  }
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function() {
          $.getJSON("/AnalysisSourceData/Test", function(data) {
              alert(data.mymsg);
          });
      });
  &lt;/script&gt;
  </code></pre>