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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Manikrag
    New Member
    • Jun 2009
    • 62

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

    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\www root\" as "ajax". I can access virtual dir thru www.myapplicati on/ajax . Both part of application are running perfect. Now I am trying to add a user control in www.myapplicati on/ajax/check.aspx. Location of the user control is as follows

    "which is under "D:\dev_sites\w ebdev.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
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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

    Comment

    • Manikrag
      New Member
      • Jun 2009
      • 62

      #3
      thanks for replying...howe ver 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...comin g 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?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        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.

        Comment

        • Manikrag
          New Member
          • Jun 2009
          • 62

          #5
          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?

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            I don't think that I'm completely understanding how the virtual directory is being used in your application.

            Comment

            • Manikrag
              New Member
              • Jun 2009
              • 62

              #7
              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!!

              Comment

              Working...