rlb.usa
rlb.usa

Reputation: 15041

Install AJAX without web.config?

I have a weird scenario, I need to use the AJAX ScriptManager and UpdatePanel on two specific ASP.NET 2.0 pages. The pages are in their own second-level directory (we don't want to make that directory a Virtual Directory). The root web.config is not AJAX enabled, and we don't want to change it.

Is is possible to use AJAX here, and how?

I was hoping it might be as easy as :

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

Upvotes: 0

Views: 416

Answers (3)

3Dave
3Dave

Reputation: 29051

I believe you can create a web.config in your target folder that overrides the settings of the global web.config in the application root.

See http://www.codeproject.com/KB/aspnet/multipleWebConfig.aspx

Mind you, I haven't tried this with tag registration, so YMMV.

Upvotes: 1

SLaks
SLaks

Reputation: 887937

You need to add a reference to System.Web.Extensions.dll to the application; without that, I'm pretty sure it's completely impossible.

However, if you just add a reference to that assembly to the root Web.config (without changing anything else), you should be able to register the tag prefix in your ASPX files, like this:

<%@ Register tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" %>

I haven't tried it, though.

Please note that if the server isn't running .Net 3.5, you'll need to copy System.Web.Extensions.dll to the application's Bin folder.

Upvotes: 1

Tomas Aschan
Tomas Aschan

Reputation: 60664

Is it an option for you to add a "local" web.config file in the sub directory in question? If you do so, all tags that are not present in the "local" file will be read from the "root" file.

Upvotes: 1

Related Questions