English 中文(简体)
将文字档案输入ASP。 NET page: intellisense show the methods, but seeking to calls one wrong. 任何想法?
原标题:Importing script files into ASP.NET page: intellisense shows the methods, but trying to call one errors. Any ideas?

我把一项职能放在现有的位置。 j 档案(我对两个不同的档案进行了审判),以便在不重复法典的情况下提供多种地方。 我甚至创造了一个简单的功能,仅仅是为了确保它不像我的职责那样重要。

function doNothing() {
    alert("Dammit."); 
}

我可以把星座清单中的方法放在我的控制下,但一旦我试图进入这一清单,就失败了。

下面是我是如何试图参考档案的,似乎在看到这些方法方面起到了作用,但还是取得了一些工作。

<script src="/javascript/messages.js" language="javascript" type="text/javascript"></script>

Any ideas? Any common mistakes that I may be making? It looks like it should work.

注:当这些方法在案卷内时,他们甚至与失踪的半殖民地一起工作。

最佳回答

即使IntelliSense建议/javascript/messages.js>,如果你的申请是在虚拟名录下而不是在网站根基上安装,那么这条道路将是错误的。 例如,Java案全文可在上查阅,但因为src从代码<>/开始,浏览器将

如您重新使用网上表格,可修改src的属性如下:

src= <%= this.Page.ResolveClientUrl("~/javascript/messages.js") %> 
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签