problem to access user control(.acsx)

  • Thread starter Thread starter BL
  • Start date Start date
B

BL

I am in a problem to access user control(.ascx) on a .aspx page

the following is my scenario

I have following directory structure -

Autoboom
- workshop
-- WSFirst
-showroom
-help

i have a user control help.ascx in folder /autoboom/help

i have registered this control in web.config like this -
<controls>
<add tagPrefix="HELP" tagName="HELP" src="~/Help/Help.ascx" />
</controls>

my problem is the help.ascx is working in any folder with same hierarchy of
help folder
for example it is working in autoboom/Workshop and autoboom/showroom
but it is not working in one folder up like /autoboom and one folder down
like /autoboom/workshop/WSFirst

i have already tried to register help control in the same page instead of
web.config but still not working

please suggest me where i am doing wrong

Thanks in advance

-BL
 
"Now working" means???????

Any errors???? Or it's just not doing laundry?


George.
 
not any error, also i can debug it, but it is not doing his work, like on
mouse over it should display a tooltip but it is not displaying, also it is
displaying a 'X" sign instead of "?" image

Thanks for responce

-BL
 
You problem is quite easy.
you are using relative path when referencing needed JavaScript and images.

And you should be using absolute path....


Here is the small tutorial

Page url: http://www.mysite.com/autoboom/workshop/mypage.aspx

has a reference to <img src="image/myimage.gif">
this is relative path and browser will make a request for
http://www.mysite.com/autoboom/workshop/image/myimage.gif
which will probably not be found.

If you had <img src="/image/myimage.gif"> (Notice first slash)

browser will look for http://www.mysite.com/image/myimage.gif
which is probably what you wanted....

George.
 
Back
Top