无法访问ascx src中的根目录 [英] cant go to the root dirctory in ascx src

查看:106
本文介绍了无法访问ascx src中的根目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始构建DNN taskMagnager moduel,我需要使用acsx页面中的控件

I start to build DNN taskMagnager moduel and I need to use the controls in acsx page

C:\inetpub\wwwroot\dnndev\controls

问题是我的项目文件夹路径为

the problem is that my project folder path is

C:\inetpub\wwwroot\dnndev\DesktopModules\TaskManager"

,而当我尝试前往这样的路径时:

and when Im trying to go to path like this:

<%@ Register TagPrefix="dnn" TagName="label" **Src="~/controls/lablecontrol.ascx"** %> 

无法找到src!

无论我做什么,总是变成

No matter what I do its always turns to

C:\inetpub\wwwroot\dnndev\DesktopModules\TaskManager\="~/controls/lablecontrol.ascx

我尝试了所有操作:tilde(〜),/../ ..

I tried everything: tilde(~), /../..

没有任何作用!

推荐答案

应该是

<%@ Register TagPrefix="dnn" TagName="label" Src="~/controls/labelcontrol.ascx" %> 

我假设您是指Visual Studio中的错误,对吗?在运行应用程序时会出现实际错误吗?

I'm assuming that you're referring to an error within Visual Studio, right? Is there an actual error when you run the application?

您可以在Visual Studio中做的一件事情来帮助它减少混乱,那就是在项目设置。转到项目设置中的 Web选项卡,确保已设置为使用IIS,然后将项目URL指向TaskManager文件夹(例如 http:// dnndev / DesktopModules / TaskManager ),然后选中替代应用程序根URL复选框,并将其设置为站点的根目录(例如 http:// dnndev )。通常,这会让Visual Studio找出标签控件正确的位置。

One thing that you can do within Visual Studio to help it be less confused is to set the Root Application path in the project settings. Go to the Web tab in the project's settings, make sure you're setup to use IIS, and point the Project URL to the TaskManager folder (e.g. http://dnndev/DesktopModules/TaskManager), and then check the Override Application Root URL checkbox, and set it to the root of the site (e.g. http://dnndev). This will usually let Visual Studio figure out where the label control is correctly.

此外,看起来您正在使用 LableControl 代替 LabelControl

Also, it looks like you're using LableControl instead of LabelControl.

这篇关于无法访问ascx src中的根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆