asp.net - The localhost page isn’t working. localhost redirected you too many times -


i got problem when debugging mvc program , want acces db called "useractivity". on browser, saying "the localhost page isn’t working

localhost redirected many times."

but without showing specific error location.

here useractivtycontroller, /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          useractivity          -- order createdon desc         -- offset (@pagenumber -1) * 30 rows         -- fetch next 30 rows             ";          //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 know problem. thanks

if (useractivity != null) {     return redirecttoaction(returnurl); } 

if returnurl points same action ("useractivity/index") create infinite redirect loop. if want redirect request different action make sure pass correct name.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -