i have a problem i am building a site in asp.net mvc3 ,
in which i made my several controllers all of them are authorized
because i don't want that unauthorized user access that controller.
Let suppose i have a controller and 2 methods in it as following
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Com.health.Controllers
{
[Authorize]
public class MyfirstController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult seeyourDetails(int id)
{
return View();
}
}
}
now let suppose our method seeyourDetails tells any user his account information , but the problem is this that when user access this method at that time the URL is http://www.exampple.com/Myfirst/seeyourDetails/10 , where 10 is current user id by which i show him his details , but what should i do, if a persons login into my site and he access this URL and manually add 10 or any other number in URL my controller will show him all details regarding that user .
Note : I can do this in one place or two places but i need some solution that i implement in one place and it effects in my whole application . Thanks