开发者

Relative path to a web application project in asp.net 4.0?

Hi all I have a project that i reference the services for my graphs...and i have hardcoded urls something like -

ViewData["weeklyGraphURL"] = "\"http://localhost:9713/MyProject/MyAction"+Id + "\"";

So this url is basically another projects controller action...and i have bo开发者_如何转开发th these projects in one solution...is there a way i could set a relative path to this project when I deploy it on the web server


If they are always going to live on the same machine you could look at reading the server name out of Request.ServerVariables.Get("SERVER_NAME") and replacing localhost with that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜