Last post Jan 24, 2018 08:44 AM by X.Daisy
Jan 23, 2018 03:10 AM|justaskingdude|LINK
I have this url http://urlhere/Home/Admin which is a view with two tabs. Clicking this tabs would access to their respective partial views - Settings and Options. But when user is accessing the partial view
by the url, http://urlhere/Home/Options or http://urlhere/Home/Settings, it is not loading the js file (which is because it is just a partial view), so the option
for this is to create a Page Not Found page.
Question here is that, how can I trigger the Page Not Found page whenever I am accessing the said urls?
Jan 24, 2018 08:44 AM|X.Daisy|LINK
We can judge the request in the action. If it's called as partial view, showing this view, else, showing Page Not Found page.
public ActionResult TestPartial()
return View(); //If it's called as partial view.
return Redirect("~/NotFoundPage.html");//If we just call it directly, it will show NotFoundPage.html.