Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Controller method calling twice in SP Provider Hosted App with MVC 5 Razor

$
0
0

Hi,

In my SharePoint Provider Hosted App in MVC 5 Razor, controller index methods are called twice every time. For example, if click on any menu item it redirect to the Index page and the page loads twice. Could anyone please help me out of this?

Here is my menu item in layout page-

<li class="active">@Html.ActionLink("Home", "Index", "Home", new { SPHostUrl = SharePointContext.GetSPHostUrl(HttpContext.Current.Request).AbsoluteUri }, null)</li>

Here is my Index Method in Home Controller-

[SharePointContextFilter]
public ActionResult Index(string searchID, int page = 1)

{ ......................... ..................... .................... return View(productList.OrderBy(p => p.createDate).ToPagedList(page, 10)); }



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>