开发者

asp.net MVC 3 action method

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜