Loading JavaScript files from a class library

A

ArtG

I have a class library that contains web controls. I would like to put Java
script files in the class library and have the web application download the
Javascript from the classlibrary. I downloaded ASP/.Net AJAX and tried the
example in http://ajax.asp.net/docs/tutorials/EmbedScriptFile.aspx but I
can't get it to work. I can't find the assembly System.Web.Extensions. When
I try to build the classlibrary I get error messages saying that it cant find
UpdatePanel and ScriptManager.

Do you know where I can find the DLL for System.Web.Extensions? Will this
solve the problem? Has anyone gotten this to work?
 
M

Mark Nelson

ArtG,

Please check whether you have done the following steps

1) Download and install the source
http://www.microsoft.com/downloads/...CC-051A-4FE6-AD72-F3BED8623B43&displayLang=en

2) Create a new C# project in Visual Studio. You can call it whatever you
want but I would suggest you avoid using the same namespace because the
System.Web namespace is strongly named and exists in several assemblies. I
called mine Dave.Web.Ajax

3) Copy all the files and folders from the source installed directory
(C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET 2.0 AJAX
Extensions\v1.0.61025\Source\System.Web.Extensions on my computer) into your
new project directory and include them in the project.

4) Make sure your Default Namespace on the project is properly set.

I'm doubting the step3, where you copy the ajax components to your project
library.
Please check that
 
A

ArtG

You're right. Now I'm getting a lot further. When I build the project, get
the following errors. Is there something else I need to copy? What should
the default namespace for the project be set to? Thanks

Error 1 The type or namespace name 'Resources' does not exist in the
namespace 'System.Web' (are you missing an assembly
reference?) d:\vsprojects\ClassLibrary3\UI\UpdatePanelControlTrigger.cs 9 22 ClassLibrary3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top