Click here to Skip to main content
15,912,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
In my web application There is a folder named admin under root directory. In admin folder there are 2 sub folder named 1. Microsite(containing 60 sub folders named 1,2,3,4,5...60) and 2. MicroContactForm (containing 10 sub folders named 1,2,3,4,5...10).

Now my problem is that when I try to redirect a page from Microsite -> sub folder(1) page to MicroContactForm -> sub folder(3) page, imges and jquery script are not loded proper that resides in Microsite -> sub folder(1).

What should i do now, Help me.... it's urgent please

Thanks

Sunil sharma
Posted
Updated 19-Mar-13 3:22am
v10

Hello,

It appears that the pages designed in MicroContactForm are referring to images andor scrips not present in the respective subfodlers under MicroContactForm. What you can try doing is to move all images, scripts, css out of these two folders out into a folder under admin and use relative paths so that browser will be able to load those artifacts correctly.

admin
  static
    js
    css
    images
  Microsite
    1
    2
    ...
    60
  MicroContactForm
    1
    2
    ...
    10


In your pages use code snippets similar to shown below to refer these artifacts
HTML
<script type="text/javascript" src="/static/js/somescript.js" />
<link type="text/css" href="/static/css/somestyle.css" />
<img src="/static/images/someimage.png" />

Regards,
 
Share this answer
 
Comments
sonusharma65 18-Mar-13 3:28am    
But how can i put all images in a single folder from 60 sub folder's(0,1,2..60) image folder.
There may be different image with same name in 60 sub folder's image folder.
Prasad Khandekar 18-Mar-13 3:34am    
Why not rename and rarrange images by say a category. e.g. images/backgrounds, images/icons, images/buttons etc.
The solution for this is to use
C#
<![CDATA[<%=Request.ApplicationPath%>]]>
in path, How?
Folowings are the example of the links i have provided in Master page of ASP.net where Contents the folder at root directory
XML
<script type="text/javascript" src="<%=Request.ApplicationPath%>/Contents/javascript/jquery/jquery-1.6.1.min.js"></script>
 <script type="text/javascript" src="<%=Request.ApplicationPath%>/Contents/javascript/jquery/ui/external/jquery.bgiframe-2.1.2.js"></script>

Observe the link you will find the
C#
<![CDATA[<%=Request.ApplicationPath%>]]>
in the path instead of absolute path ("~") or relative path ".../" when page request from one path to other path the dotnet itselt will manage the things related to path.

You may get following error while using such path
Quote:
Code-blocks are not allowed in this file

if so the replace = with #
<script type="text/javascript" src="<%#Request.ApplicationPath%>/Contents/javascript/jquery/jquery-1.6.1.min.js"></script>


and use for vb.net
Me.Page.Header.DataBind()

and
this.Page.Header.DataBind()
for C# in code behind


Hope this may help you-Enjoy Coding
 
Share this answer
 
Comments
kishore sharma 18-Mar-13 3:37am    
same way you can use for image path too

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900