I am having trouble debugging my MVC program and I want to access my db called "UserActivity". in the browser it says that the "localhost page is not working
localhost redirected you too many times.
but without specifying the specific location of the error.
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); } }
Do evaluate if there is anyone who knows something about this issue. Thanks
source share