开发者

asp.net MVC 3 action method

开发者 https://www.devze.com 2023-04-10 10:11 出处:网络
I have created a partial view and I am using it in admin controller\'s Home action method. Inside partial view, I have an Account Controller with action method named Logon. I am trying to access main

I have created a partial view and I am using it in admin controller's Home action method. Inside partial view, I have an Account Controller with action method named Logon. I am trying to access main view's URL like this

 if (Url.ToString().T开发者_开发百科oLower().Contains("/admin"))
                return Redirect("/Admin/Index");

but I cant get the required result. How to get it admin/home ?


From the comments above it looks like you want to just access the current url. If so, then you can simply use the Request object. E.g.

Request.Url.AbsoluteUri

I wonder why you need this though... what is it you are trying to do exactly?

0

精彩评论

暂无评论...
验证码 换一张
取 消