2010-02-08 30 views
0

在c#中我需要动态框架下面的URL,这里的行动是redirectURL和控制器是书籍,当我发布页面我发送url到其他页面在follwing format.is它posible动态地使用“localhost:7187”来构建URL? http://localhost:7187/Books/redirectURL动态框架URl在c#

+0

你的问题有点难以理解。你能添加一些代码来更好地解释你的情况吗? – Kane 2010-02-08 05:04:23

+0

你是什么意思“框架网址”? – 2010-02-08 09:41:20

回答

0

Folllwing方式我框架的URL(http://localhost:7187/Books/redirectURL)动态

Classname.WebsitePath + VirtualPathUtility.ToAbsolute(Url.Action( “的redirectUrl”, “书”));

公共静态字符串WebsitePath { 得到 { 回报HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); } }