سلام دوستان
در سایتم اکشنهایی که از طریق رفتن به آدرس فراخوانی میشن ، دوبار اجرا میشن. بعد از اینکه صفحه ویو نشون داده شد در بک گراند همون اکشن دوباره فراخوانی میشه.
namespace TravelEnterAdminTemplate.Controllers
{
public class ArtPlacesController : Controller
{
private TravelEnterDBEntities1 db = new TravelEnterDBEntities1();
private Models.Utility.ErrorLog errorlog = new Models.Utility.ErrorLog();
public async Task<ActionResult> Index()
{
try
{
var artPlaces = db.ArtPlaces.Include(a => a.AspNetUser).Include(a => a.City);
return View(await artPlaces.ToListAsync());
}
catch (Exception e)
{
errorlog.Error("IndexArtPlaces", "25", e.Source.ToString(), e.Message);
return View("Error", TempData["Error"]);
}
}
}
}
RouteConfig :
namespace TravelEnterAdminTemplate{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
} }
دوستان لطفا راهنمای کنید