0

I have moved a view from folder to Shared folder. When I try to navigate from controller to the shared view it is navigating to the default view and not the shared view. I checked in Global.asax, I created new route in the Global.asax, but it is still pointing to the default route and loading the default view.

Could anyone help me in resolving this issue?

1
  • 3
    Need more details. What is default view, why it should go to shared view and so on. Commented Sep 29, 2011 at 9:58

2 Answers 2

3

Make sure the old view is deleted, otherwise it will always pick that one over the shared folder.

Sign up to request clarification or add additional context in comments.

Comments

1

if you have not explicitly defined the name of the view e.g lets suppose you have an ActionResult in Home controller

public ActionResult Index()
{
return View();
}

the view by the name of Index.aspx and/or Index.ascx is searched first in the Home folder which is present in the Views folder if a matching veiw is found there it is not searched further. If it is not found then it will be searched in the Shared folder

make sure you have deleted the view form the Default location

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.