Could not find a part of the path 'D:\PROJECTS15SEP2011\BUGTRACKER\BUGTRACKERSITE\Account\Resources\Profile\5c18c345cf304a97b7f49c1744e844e7_apr-18-2012-16-15-36.gif'.
Site Root folder is:
D:\PROJECTS15SEP2011\BUGTRACKER\BUGTRACKERSITE
The correct path for files upload should be:
Could not find a part of the path 'D:\PROJECTS15SEP2011\BUGTRACKER\BUGTRACKERSITE\Resources\Profile\5c18c345cf304a97b7f49c1744e844e7_apr-18-2012-16-15-36.gif'.
dfnaveed
0 Points
4 Posts
Images and Links Paths Issue
Apr 18, 2012 10:26 AM|LINK
Normaly I used to build my links within my site as
<a href="/Tasks/Create"> maps to http://ww.mysite.com/tasks/create
<a href="/Tasks/Delete"> maps to http://ww.mysite.com/tasks/delete
to map the path to route.
But what should be the trick to map these paths exactly if my site reside in a subdomain?
<a href="???????"> maps to http://ww.mysite.com/myteam/tasks/create
<a href="???????"> maps to http://ww.mysite.com/myteam/tasks/delete
where 'myteam' is subdomain like seprate application.
I have MVC3 Site Project
Thanks
Ken Tucker
All-Star
16797 Points
2608 Posts
MVP
Re: Images and Links Paths Issue
Apr 18, 2012 10:32 AM|LINK
use url.content to get the right path
http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.content.aspx
Space Coast .Net User Group
dfnaveed
0 Points
4 Posts
Re: Images and Links Paths Issue
Apr 18, 2012 10:42 AM|LINK
HI Ken Tucke,
Thanks for quick response. Your solution works perfect. But this line is not working
In stylesheet (.css file)
background-image: url('@Url.Content("Images/gray_bullet.png")');
before this change, I had
background-image: url('/Images/gray_bullet.png');
Thanks.
vijay_myl
Contributor
5070 Points
1068 Posts
Re: Images and Links Paths Issue
Apr 18, 2012 10:58 AM|LINK
hi..For applyimg path to css
Try this code.
background-image: url(../Images/gray_bullet.png);
background: url(../css/menu_div.gif)
My .NET blog
Submit Article
dfnaveed
0 Points
4 Posts
Re: Images and Links Paths Issue
Apr 18, 2012 11:21 AM|LINK
Great, it works.
Now I have the same issue with my file upload/Create/Delete path
I am using this line:
strAttachmentFile = Common.GetGUIDFileName() + FileExtension; string strCombinedPath = Path.Combine(HttpContext.Request.MapPath(Url.Content("/Resources/Profile/")), strAttachmentFile); attachmentFile.SaveAs(strCombinedPath);Which results in error
Could not find a part of the path 'D:\PROJECTS15SEP2011\BUGTRACKER\BUGTRACKERSITE\Account\Resources\Profile\5c18c345cf304a97b7f49c1744e844e7_apr-18-2012-16-15-36.gif'.
Site Root folder is:
D:\PROJECTS15SEP2011\BUGTRACKER\BUGTRACKERSITE
The correct path for files upload should be:
Could not find a part of the path 'D:\PROJECTS15SEP2011\BUGTRACKER\BUGTRACKERSITE\Resources\Profile\5c18c345cf304a97b7f49c1744e844e7_apr-18-2012-16-15-36.gif'.
dfnaveed
0 Points
4 Posts
Re: Images and Links Paths Issue
Apr 25, 2012 06:29 AM|LINK
Thanks Ken Tucker and vijay_myl for kind support.