Connecting Tech Pros Worldwide Forums | Help | Site Map

error UserControl(ascx) does does not exist when accessing thru virtual dir

Member
 
Join Date: Jun 2009
Location: Bangalore
Posts: 44
#1: Sep 17 '09
Hi Team,

I am trying to access a user control on a aspx page but I am getting error:
"The file '/ajax/include/aspnet/Web.TopBanner4.ascx' does not exist"

Let me explain the situation - I have an application running on IIS and located in D drive of the server, recently I have added a virtual directory in "C:\Inetpub\wwwroot\" as "ajax". I can access virtual dir thru www.myapplication/ajax . Both part of application are running perfect. Now I am trying to add a user control in www.myapplication/ajax/check.aspx. Location of the user control is as follows

"which is under "D:\dev_sites\webdev.ariba.com\include\aspnet"

I have added "<%@ Reference Control="~/include/aspnet/Web.TopBanner4.ascx" %>" in check.aspx but ASP control is not able to find the user control. I have tried ../ and other methods but of no luck.

Please help!!

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#2: Sep 17 '09

re: error UserControl(ascx) does does not exist when accessing thru virtual dir


This sounds a bit crazy, I have no idea why this is so complicated.

I would recommend opening Visual Studio and adding the user control using the "Add An Existing Item" option. This will copy the user control into the current project.

Build the project, test it, then publish it.


-Frinny
Member
 
Join Date: Jun 2009
Location: Bangalore
Posts: 44
#3: Sep 17 '09

re: error UserControl(ascx) does does not exist when accessing thru virtual dir


thanks for replying...however there are few dependencies due to which we can not move the user control..or it will not be tht eaiser as it is sounding..so much of dependencies on other controls/classes...coming back on my question..
Is there any simple way of calling or refer the user control from an aspx page which is in a Virtual dir instead of moving user control in virtual dir?
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#4: Sep 17 '09

re: error UserControl(ascx) does does not exist when accessing thru virtual dir


You can't copy the user control ??
I guess if there's a lot of controls/classes involved in that one user control it would be take some time to modify for the new project but I think that this will not only save you a headache in the future but also solve your current problem.
Member
 
Join Date: Jun 2009
Location: Bangalore
Posts: 44
#5: Sep 17 '09

re: error UserControl(ascx) does does not exist when accessing thru virtual dir


You are right and i will follow it if there is no option but a calling usercontrl workaround would be smart and quick approch and i need it quickly..

y cant we use user control if the virtual directory is the part of application and the same is working perfectly in application itself? thr should be smthing. Isn't it?
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#6: Sep 17 '09

re: error UserControl(ascx) does does not exist when accessing thru virtual dir


I don't think that I'm completely understanding how the virtual directory is being used in your application.
Member
 
Join Date: Jun 2009
Location: Bangalore
Posts: 44
#7: Sep 17 '09

re: error UserControl(ascx) does does not exist when accessing thru virtual dir


thanks for asking this bro..i dont know what was the use of using virtual dir here..the application is an old one and we can have all the pages in the mail directory..tht will simply solve the issue..but before that let me quickly see if there is any hidden use of virtual dir.

thanks frinavale...you are the best!!
Reply

Tags
directory, usercontrol, virtual