Get current controller in view .net mvc

 


@HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString()


var path = '@ViewContext.RouteData.Values["controller"]@ViewContext.RouteData.Values["action"]';

 alert(path);


Get current controller in view .net mvc Get current controller in view .net mvc Reviewed by Leo on April 10, 2022 Rating: 5

Tidak ada komentar

About me

About Me

My name is Joanne Doe, a lifestyle photographer and blogger currently living in Osaka, Japan. I write my thoughts and travel stories inside this blog.