1
Reply

how to show mutiple views in sam page using mvc sitemap

athira k

athira k

May 29 2017 4:17 AM
215
I am doing a project and got stuck in an area that I have a registration form and in that it will ask whether it is admin or user. If it is admin it must show the full data in DB and if it is user it must only visible with the user detail. And these are doing in MVC sitemap. The main problem is that I don't have an idea that how can I give condition in this MVC sitemap and display items. I have searched for this but didn't get a correct idea. sitemap
 
<mvcSiteMapNode title="Registration" url="/50" controller="Account" action="Register"  description="">  
<mvcSiteMapNode title="Admin" url="/55" description=""> 
<mvcSiteMapNode title="user" controller="User" action="Index"  description=""/>
 <mvcSiteMapNode title="PostDetails" controller="PostDetails" action="Index"  description=""/>
 </mvcSiteMapNode> 
</ <mvcSiteMapNode>

here when I click on the registration it will move to the registration form and in that, it will ask whether it is user or not and if it is only the user part is visible to the user and needs to hide admin part

this is my routeconfig


public class RouteConfig {

public static void RegisterRoutes(RouteCollection routes) {

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(

name: "Default",

url: "{controller}/{action}/{id}",

defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }

); }

can anyone please explain to me how to do this?


 

Answers (1)