Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 24, 2012 03:45 PM by archie8
Member
428 Points
308 Posts
Feb 22, 2012 09:44 AM|LINK
hi everyone,
i just recently deployed a project online, and i notice that online, images dont appear
and ajax and jqeuery doesnt work either. it all worked fined when i ran it on localhost
in Visual Studio.
what could be the problem?
if you need me to post code, please tell me which bits
thanks
Feb 22, 2012 10:25 AM|LINK
ok so i kinda fixed ajax online, using Url.Action() which i found from this post (marked answer):
http://stackoverflow.com/questions/5251992/using-jquery-post-for-mvc-3-not-working-when-deployed
now just for jquery and image... anyone?
Contributor
2600 Points
484 Posts
Feb 22, 2012 07:14 PM|LINK
Can you tell me from where you are pulling image from (same server or different server )
Feb 23, 2012 08:07 AM|LINK
Shellymn Can you tell me from where you are pulling image from (same server or different server )
hi shellymn, yes its the same server. when i open my site in IIS Manager i see the images in the folder.
so the images are there. its confusing because it works fine when i run on local pc in debugging on visual studio.
All-Star
42885 Points
7019 Posts
MVP
Feb 23, 2012 02:59 PM|LINK
Hi,
Check the paths of the images. You should give relative paths for them.
Please 'Mark as Answer' if this post helps you.
Feb 23, 2012 03:42 PM|LINK
hi, what do u mean by relative paths?
this is a line from one of my viewpages:
<img src="/Assets/Images/pic.png" alt="Sample Photo" />
and this is another line in my stylesheet:
background: transparent url('/Assets/Images/tipBtm.png') no-repeat bottom;
many thanks
Feb 23, 2012 03:47 PM|LINK
archie8 hi, what do u mean by relative paths?
Relative path means the image path relative to the page you are accessing the images.
archie8 <img src="/Assets/Images/pic.png" alt="Sample Photo" />
That means, the image pic.png should be inside the Images folder, which is inside the Assets folder Which should be in the same folder as your page. Can I see your directory heirarchy so I can help you to write relative paths? :)
Feb 23, 2012 03:51 PM|LINK
hi yes its as follows:
project
|__ Areas
|__Setup
|__ Model, View, Controller folders
|__ Assets
|__ Images
|__ pic.png
and so on...
hope that helps
Feb 23, 2012 04:03 PM|LINK
And where is your page on that heirarchy? In which folder?
Feb 24, 2012 07:41 AM|LINK
sorry for late reply, my page is in the view folder
archie8
Member
428 Points
308 Posts
problem with jquery and ajax after deployment
Feb 22, 2012 09:44 AM|LINK
hi everyone,
i just recently deployed a project online, and i notice that online, images dont appear
and ajax and jqeuery doesnt work either. it all worked fined when i ran it on localhost
in Visual Studio.
what could be the problem?
if you need me to post code, please tell me which bits
thanks
archie8
Member
428 Points
308 Posts
Re: problem with jquery and ajax after deployment
Feb 22, 2012 10:25 AM|LINK
ok so i kinda fixed ajax online, using Url.Action() which i found from this post (marked answer):
http://stackoverflow.com/questions/5251992/using-jquery-post-for-mvc-3-not-working-when-deployed
now just for jquery and image... anyone?
thanks
Shellymn
Contributor
2600 Points
484 Posts
Re: problem with jquery and ajax after deployment
Feb 22, 2012 07:14 PM|LINK
Can you tell me from where you are pulling image from (same server or different server )
archie8
Member
428 Points
308 Posts
Re: problem with jquery and ajax after deployment
Feb 23, 2012 08:07 AM|LINK
hi shellymn, yes its the same server. when i open my site in IIS Manager i see the images in the folder.
so the images are there. its confusing because it works fine when i run on local pc in debugging on visual studio.
Ruchira
All-Star
42885 Points
7019 Posts
MVP
Re: problem with jquery and ajax after deployment
Feb 23, 2012 02:59 PM|LINK
Hi,
Check the paths of the images. You should give relative paths for them.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.archie8
Member
428 Points
308 Posts
Re: problem with jquery and ajax after deployment
Feb 23, 2012 03:42 PM|LINK
hi, what do u mean by relative paths?
this is a line from one of my viewpages:
<img src="/Assets/Images/pic.png" alt="Sample Photo" />
and this is another line in my stylesheet:
background: transparent url('/Assets/Images/tipBtm.png') no-repeat bottom;
many thanks
Ruchira
All-Star
42885 Points
7019 Posts
MVP
Re: problem with jquery and ajax after deployment
Feb 23, 2012 03:47 PM|LINK
Hi,
Relative path means the image path relative to the page you are accessing the images.
That means, the image pic.png should be inside the Images folder, which is inside the Assets folder Which should be in the same folder as your page. Can I see your directory heirarchy so I can help you to write relative paths? :)
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.archie8
Member
428 Points
308 Posts
Re: problem with jquery and ajax after deployment
Feb 23, 2012 03:51 PM|LINK
hi yes its as follows:
project
|__ Areas
|__Setup
|__ Model, View, Controller folders
|__ Assets
|__ Images
|__ pic.png
and so on...
hope that helps
Ruchira
All-Star
42885 Points
7019 Posts
MVP
Re: problem with jquery and ajax after deployment
Feb 23, 2012 04:03 PM|LINK
And where is your page on that heirarchy? In which folder?
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.archie8
Member
428 Points
308 Posts
Re: problem with jquery and ajax after deployment
Feb 24, 2012 07:41 AM|LINK
sorry for late reply, my page is in the view folder