In asp.net mvc 4 and mvc 5. How to mange menu in Xml file?. In mvc web application individual user assigned menu is store in separate xml file.
and user login only open assigned menu not other menu. If user is type another page url is going to error page

Surendra KandiraPosted Oct 1, 2015, 9:47 AM
VijayPosted Jul 16, 2015, 12:27 AM
Surendra KandiraPosted Jul 15, 2015, 3:59 AM
{
public List
}
public class Module
{
public string name { get; set; }
public List
{
XmlDocument doc = new XmlDocument();
int id = Convert.ToInt32(User.Identity.Name);
string path = Server.MapPath("~/XMLFiles/xxxx.xml");
doc.Load(path);
menu me = new menu();
me.Module = new List
XmlNodeList xnList = doc.SelectNodes("/Modules/Module");
// List
foreach (XmlNode xn in xnList)
{
Module md = new Module();
md.name = xn.Attributes["name"].InnerText;
md.form = new List
@foreach (var module in Model.Module)
{
if (module.form.Count > 0)
{
@foreach (var form in module.form)
{
@if (form.form1.Count > 0)
{
@foreach (var formn in form.form1)
{
}
}
}
}
}