You can create a controller action for the partial view. But if you are looking for inlcluding some thing on every page, you should think about adding that to your _Layout.cshtml page
You can create a normal action method which returns a partial view like this
public ActionResult UserInfo()
{
UserViewModel objVm=GetUserInf();
// do some stuff
return View("PartialUserInfo",objVM);
}
This will return a view with name "PartialUserInfo
" present in your Views/Users
folder( Assuming your controller name is Users. If you want to specify a view which is a different location you can mention it when calling the View method
returnView("Partial/UserInfo",objVm);
This will return a View called "UserInfo" in your Views/Users/Partial
folder.
in your partial view, you can disable the normal layout( if you have one) by doint this
@model UserViewModel
@{
Layout=null;
}