The shared folder was not displayed in my Solution Explorer at first, but the shared folder actually exists in the project, and I searched it as if there were no similar answers (perhaps the keywords I searched for were not accurate enough). Later I saw the next vs2012.
In fact, the solution is simple:
First, view-"Solution Explorer." In Solution Explorer, click on the red box in the "Show All Files" box.
Then you'll see a file similar to the one in the picture, find what you want, right-click, and click "Include in Project" in the Red box.
MVC partial view shows changes before and after landing
And the effect is like this
Pre-logon:;
After landing:
First, right-click the shared folder and add the view: (e.g.)
In the partial view:
<%@ Control language="C #"inherits="System.Web.Mvc.ViewUserControl"%> <%if(session["Nickname"] ==NULL) { %> <ulclass="Logintop"> <li><a href="<%=url.action ("Login","Account")%>"Rel="nofollow"> Login </a></li> <li>|</li> <li><a href="<%=url.action ("Register","Account")%>"Rel="nofollow"> Registration </a></li> </ul><%} Else { %> <DLclass="Collapsible_menu"> <dt> <span id="nowrap"><%=session["Nickname"]%></span> <span id="Noticedot" class="Red DN"></span> <i></i> </dt> < ;DD ><a href="#"Rel="nofollow"> My CV </a></dd> <dd><a href="#"> My favorite jobs </a></dd> <dd> <a id="Noticeno"href="#"> The position I posted <spanclass="Red DN"></span></a> </dd> <DDclass="BTM"><a href="#"> My subscription </a></dd> <dd><a href="#"> I want to recruit </a></dd> <dd><a I D="accountsetting"href="#"> Account Settings </a></dd> <ddclass="Logout"><a href="#"Rel="nofollow"> Exit </a></dd> </dl><%}%>
In the proper location of the master page:
<%=html.partial ("Partial1")%>
MVC partial view (partial) displays changes before and after login and the shared folder does not appear in Solution Explorer