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
localhost redirected you too many times.”
but without showing the specific error location.
here is my UserActivtyController, GET /UserActivity/Index 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<UserActivityModels> userActivity = null; using (IDbConnection db = new MySqlConnection(ConfigurationManager.ConnectionStrings["CRMPORTALSQLCONN"].ConnectionString)) { userActivity = (List<UserActivityModels>)db.Query<UserActivityModels>(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); } }
Really appreciate if there anyone who know something about this problem. Thanks