本文介绍了“的ScriptManager'的名称未在当前的背景下存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我复制了一些code,以解决问题与ASP.Net AJAX的回发后运行的JavaScript。不幸的是,新的code做一个编译时给了我以下错误:

I copied some code to solve a problem with running JavaScript after an AJAX postback in ASP.Net. Unfortunately the new code gave me the following error when doing a build:

The name 'ScriptManager' does not exist in the current context

现在,我之前使用的ScriptManager的,那么,为什么它被现在给我的问题?是不是适用于所有的ASP.Net网页?我有一个脚本管理我的母版页上毕竟...

Now I've used the ScriptManager before, so why would it be giving me problems now? Isn't it available on all ASP.Net pages? I have a script manager on my master page after all...

推荐答案

我想可能有一些事情出错,将产生此错误消息。但对我来说,我不得不做的是以下使用添加到我的$ C $顶部的C-隐藏文件:

I suppose there could be a number of things wrong that would generate this error message. But for me, all I had to do was add the following using to the top of my code-behind file:

using System.Web.UI;

我希望这有助于有人在那里,也许它会为您节省一些时间。

I hope this helps someone out there, maybe it'll save you some time.

这篇关于“的ScriptManager'的名称未在当前的背景下存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 21:07