title: The localhost page isn’t working. localhost redirected you too many times
body: <p>I got a problem when debugging my MVC program and I want to acces to my db called "UserActivity".
  on the browser, it saying that "The localhost page isn’t working</p>
  
  <p>localhost redirected you too many times."</p>
  
  <p>but without showing the specific error location.</p>
  
  <p>here is my UserActivtyController, GET /UserActivity/Index code:</p>
  
  <pre><code>public class UserActivityController : BaseController
  {
      //GET /UserActivity/Index
      public ActionResult Index(string returnUrl, int page = 1, string sort = "Id", string sortDir = "ASC", string filter = null)
      {
          String query = @"
              SELECT Id
              ,CreatedBy
              ,CreatedOn
              ,ModifiedBy
              ,ModifiedOn
              ,ContactId
              ,EntityName
              ,EntityId
              ,ActivityType
              ,ActivityStatus
              ,DueDate
              ,ActualEndDate
              ,MasqueradeOn
              ,MasqueradeBy 
          FROM UserActivity 
          -- ORDER BY CreatedOn DESC
          -- OFFSET (@PageNumber -1) * 30 ROWS
          -- FETCH NEXT 30 ROWS ONLY
              ";
  
          //string countQuery = @""
  
          List&lt;UserActivityModels&gt; userActivity = null;
  
          using (IDbConnection db = new MySqlConnection(ConfigurationManager.ConnectionStrings["CRMPORTALSQLCONN"].ConnectionString))
          {
              userActivity = (List&lt;UserActivityModels&gt;)db.Query&lt;UserActivityModels&gt;(query, new
              {
                  @PageNumber = page,
  
              });
  
              /*ViewData["TotalCount"] = (int)db.ExecuteScalar(countQuery, new
              {
                  @PageNumber = page,
                  @Id = string.IsNullOrEmpty(filter) ? null : filter
              });
              */
  
              ViewData["PageSize"] = 30;
              ViewData["Filter"] = filter;
          }
  
          if (userActivity != null)
          {
              return RedirectToAction(returnUrl);
          }
  
          return View(userActivity);
      }
  }
  </code></pre>
  
  <p>Really appreciate if there anyone who know something about this problem. Thanks</p>