PC Review


Reply
Thread Tools Rate Thread

Adding AJAX to an existing Web Application

 
 
Jason
Guest
Posts: n/a
 
      4th Oct 2007
Hello,

I am trying to utilitze the AJAX Control toolkit in my asp.net project. I
have added a reference to AjaxControlToolkit.dll, and in my page, added
these lines of code:

<ajaxToolkit:ToolkitScriptManager runat="Server"
EnableScriptGlobalization="true" EnableScriptLocalization="true"
ID="ScriptManager1" />

<asp:TextBox runat="server" ID="txtFromDate" />

<asp:ImageButton runat="Server" ID="Image1" ImageUrl="/images/calendar.png"
AlternateText="Click to show calendar" /><br />

<ajaxToolkit:CalendarExtender ID="calendarButtonExtender" runat="server"
TargetControlID="txtFrom" PopupButtonID="Image1" />





Everything builds fine, but when I actually run the page I get the error:



Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: CS0012: The type 'System.Web.UI.ScriptManager' is
defined in an assembly that is not referenced. You must add a reference to
assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.



I then added a reference to System.Web.Extensions, but I get the same error
when I refresh the page. Am I adding this reference the wrong way?

Also, and this may be related, I don't see the AJAX toolkit in my toolbox.
What am I not doing?



Thanks-

Jason


 
Reply With Quote
 
 
 
 
Mike Placentra II
Guest
Posts: n/a
 
      4th Oct 2007
On Oct 4, 4:33 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
> Hello,
>
> I am trying to utilitze the AJAX Control toolkit in my asp.net project. I
> have added a reference to AjaxControlToolkit.dll, and in my page, added
> these lines of code:
>
> <ajaxToolkit:ToolkitScriptManager runat="Server"
> EnableScriptGlobalization="true" EnableScriptLocalization="true"
> ID="ScriptManager1" />
>
> <asp:TextBox runat="server" ID="txtFromDate" />
>
> <asp:ImageButton runat="Server" ID="Image1" ImageUrl="/images/calendar.png"
> AlternateText="Click to show calendar" /><br />
>
> <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" runat="server"
> TargetControlID="txtFrom" PopupButtonID="Image1" />
>
> Everything builds fine, but when I actually run the page I get the error:
>
> Description: An error occurred during the compilation of a resource required
> to service this request. Please review the following specific error details
> and modify your source code appropriately.
>
> Compiler Error Message: CS0012: The type 'System.Web.UI.ScriptManager' is
> defined in an assembly that is not referenced. You must add a reference to
> assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
> PublicKeyToken=31bf3856ad364e35'.
>
> I then added a reference to System.Web.Extensions, but I get the same error
> when I refresh the page. Am I adding this reference the wrong way?
>
> Also, and this may be related, I don't see the AJAX toolkit in my toolbox.
> What am I not doing?
>
> Thanks-
>
> Jason


You have to add the AJAX toolkit to your toolbox manually from the
context menu | 'choose items...'.

Try going to the 'Website' menu | 'Add Reference...' | 'Browse' tab
and adding it that way.

-Michael Placentra II

 
Reply With Quote
 
Mike Placentra II
Guest
Posts: n/a
 
      4th Oct 2007
> Try going to the 'Website' menu | 'Add Reference...' | 'Browse' tab
> and adding it that way.


By the second part I meant to add a reference to the assembly, not
still to the toolbox.

-Michael Placentra II

 
Reply With Quote
 
Jason
Guest
Posts: n/a
 
      4th Oct 2007
Thanks Michael,

I was able to add the controls to the toolbox using your suggestion, as for
the second issue, the problem still occurred.

After removing and re-adding the reference usng your suggestion, it works
like it should.

Thanks Michael!

Jason


"Mike Placentra II" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> On Oct 4, 4:33 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
>> Hello,
>>
>> I am trying to utilitze the AJAX Control toolkit in my asp.net project. I
>> have added a reference to AjaxControlToolkit.dll, and in my page, added
>> these lines of code:
>>
>> <ajaxToolkit:ToolkitScriptManager runat="Server"
>> EnableScriptGlobalization="true" EnableScriptLocalization="true"
>> ID="ScriptManager1" />
>>
>> <asp:TextBox runat="server" ID="txtFromDate" />
>>
>> <asp:ImageButton runat="Server" ID="Image1"
>> ImageUrl="/images/calendar.png"
>> AlternateText="Click to show calendar" /><br />
>>
>> <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" runat="server"
>> TargetControlID="txtFrom" PopupButtonID="Image1" />
>>
>> Everything builds fine, but when I actually run the page I get the error:
>>
>> Description: An error occurred during the compilation of a resource
>> required
>> to service this request. Please review the following specific error
>> details
>> and modify your source code appropriately.
>>
>> Compiler Error Message: CS0012: The type 'System.Web.UI.ScriptManager' is
>> defined in an assembly that is not referenced. You must add a reference
>> to
>> assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
>> PublicKeyToken=31bf3856ad364e35'.
>>
>> I then added a reference to System.Web.Extensions, but I get the same
>> error
>> when I refresh the page. Am I adding this reference the wrong way?
>>
>> Also, and this may be related, I don't see the AJAX toolkit in my
>> toolbox.
>> What am I not doing?
>>
>> Thanks-
>>
>> Jason

>
> You have to add the AJAX toolkit to your toolbox manually from the
> context menu | 'choose items...'.
>
> Try going to the 'Website' menu | 'Add Reference...' | 'Browse' tab
> and adding it that way.
>
> -Michael Placentra II
>



 
Reply With Quote
 
Jason
Guest
Posts: n/a
 
      4th Oct 2007
Darn, spoke too soon.

I was able to successfully add the controls to the toolbox, add the assembly
reference to the project, and register the assembly just fine in my .aspx
with this code:

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

But after adding this line of code:

<ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />

I see a JavaScript error that says "'Sys' is undefined".

Is there something else I am not including. This is a web application
project, not a website project, if that makes a difference.

Thanks

Jason

"Jason" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Michael,
>
> I was able to add the controls to the toolbox using your suggestion, as
> for the second issue, the problem still occurred.
>
> After removing and re-adding the reference usng your suggestion, it works
> like it should.
>
> Thanks Michael!
>
> Jason
>
>
> "Mike Placentra II" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> On Oct 4, 4:33 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
>>> Hello,
>>>
>>> I am trying to utilitze the AJAX Control toolkit in my asp.net project.
>>> I
>>> have added a reference to AjaxControlToolkit.dll, and in my page, added
>>> these lines of code:
>>>
>>> <ajaxToolkit:ToolkitScriptManager runat="Server"
>>> EnableScriptGlobalization="true" EnableScriptLocalization="true"
>>> ID="ScriptManager1" />
>>>
>>> <asp:TextBox runat="server" ID="txtFromDate" />
>>>
>>> <asp:ImageButton runat="Server" ID="Image1"
>>> ImageUrl="/images/calendar.png"
>>> AlternateText="Click to show calendar" /><br />
>>>
>>> <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" runat="server"
>>> TargetControlID="txtFrom" PopupButtonID="Image1" />
>>>
>>> Everything builds fine, but when I actually run the page I get the
>>> error:
>>>
>>> Description: An error occurred during the compilation of a resource
>>> required
>>> to service this request. Please review the following specific error
>>> details
>>> and modify your source code appropriately.
>>>
>>> Compiler Error Message: CS0012: The type 'System.Web.UI.ScriptManager'
>>> is
>>> defined in an assembly that is not referenced. You must add a reference
>>> to
>>> assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
>>> PublicKeyToken=31bf3856ad364e35'.
>>>
>>> I then added a reference to System.Web.Extensions, but I get the same
>>> error
>>> when I refresh the page. Am I adding this reference the wrong way?
>>>
>>> Also, and this may be related, I don't see the AJAX toolkit in my
>>> toolbox.
>>> What am I not doing?
>>>
>>> Thanks-
>>>
>>> Jason

>>
>> You have to add the AJAX toolkit to your toolbox manually from the
>> context menu | 'choose items...'.
>>
>> Try going to the 'Website' menu | 'Add Reference...' | 'Browse' tab
>> and adding it that way.
>>
>> -Michael Placentra II
>>

>
>



 
Reply With Quote
 
Mike Placentra II
Guest
Posts: n/a
 
      4th Oct 2007
I don't have any trouble using the <ajax:ScriptManager /> control
instead of <ajaxToolkit:ToolkitScriptManager /> with AJAX Toolkit. All
of the AJAX Toolkit controls work with the regular one for me. I
didn't realize there was an <ajaxToolkit:ToolkitScriptManager />.

Try the <ajax:ScriptManager /> instead (or it might be a different XML
namespace for you depending on how you have it configured).

-Michael Placentra II


On Oct 4, 5:55 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
> But after adding this line of code:
>
> <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />
>
> I see a JavaScript error that says "'Sys' is undefined".
>
> Is there something else I am not including. This is a web application
> project, not a website project, if that makes a difference.
>
> Thanks
> Jason


 
Reply With Quote
 
Jason
Guest
Posts: n/a
 
      4th Oct 2007
Thanks Mike,

No joy though. Still get the same error.

"Mike Placentra II" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>I don't have any trouble using the <ajax:ScriptManager /> control
> instead of <ajaxToolkit:ToolkitScriptManager /> with AJAX Toolkit. All
> of the AJAX Toolkit controls work with the regular one for me. I
> didn't realize there was an <ajaxToolkit:ToolkitScriptManager />.
>
> Try the <ajax:ScriptManager /> instead (or it might be a different XML
> namespace for you depending on how you have it configured).
>
> -Michael Placentra II
>
>
> On Oct 4, 5:55 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
>> But after adding this line of code:
>>
>> <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />
>>
>> I see a JavaScript error that says "'Sys' is undefined".
>>
>> Is there something else I am not including. This is a web application
>> project, not a website project, if that makes a difference.
>>
>> Thanks
>> Jason

>



 
Reply With Quote
 
Jason
Guest
Posts: n/a
 
      4th Oct 2007
I fixed it by creating an empty "Ajax-enabled Web Application" project, then
seeing what sections the web.config file in that project had that mine
didn't.

I copied in the missing sections from the new project's web.config into my
project's web.config and that did the trick!

Thanks again for your help,

Jason


"Jason" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Thanks Mike,
>
> No joy though. Still get the same error.
>
> "Mike Placentra II" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>>I don't have any trouble using the <ajax:ScriptManager /> control
>> instead of <ajaxToolkit:ToolkitScriptManager /> with AJAX Toolkit. All
>> of the AJAX Toolkit controls work with the regular one for me. I
>> didn't realize there was an <ajaxToolkit:ToolkitScriptManager />.
>>
>> Try the <ajax:ScriptManager /> instead (or it might be a different XML
>> namespace for you depending on how you have it configured).
>>
>> -Michael Placentra II
>>
>>
>> On Oct 4, 5:55 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
>>> But after adding this line of code:
>>>
>>> <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />
>>>
>>> I see a JavaScript error that says "'Sys' is undefined".
>>>
>>> Is there something else I am not including. This is a web application
>>> project, not a website project, if that makes a difference.
>>>
>>> Thanks
>>> Jason

>>

>
>



 
Reply With Quote
 
Kbalz
Guest
Posts: n/a
 
      5th Oct 2007
On Oct 4, 6:52 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
> I fixed it by creating an empty "Ajax-enabled Web Application" project, then
> seeing what sections the web.config file in that project had that mine
> didn't.
>
> I copied in the missing sections from the new project's web.config into my
> project's web.config and that did the trick!
>
> Thanks again for your help,
>
> Jason
>
> "Jason" <JasonJa...@nospam.nospam> wrote in message
>
> news:%(E-Mail Removed)...
>
>
>
> > Thanks Mike,

>
> > No joy though. Still get the same error.

>
> > "Mike Placentra II" <nothingsoriginalontheinter...@gmail.com> wrote in
> > messagenews:(E-Mail Removed)...
> >>I don't have any trouble using the <ajax:ScriptManager /> control
> >> instead of <ajaxToolkit:ToolkitScriptManager /> with AJAX Toolkit. All
> >> of the AJAX Toolkit controls work with the regular one for me. I
> >> didn't realize there was an <ajaxToolkit:ToolkitScriptManager />.

>
> >> Try the <ajax:ScriptManager /> instead (or it might be a different XML
> >> namespace for you depending on how you have it configured).

>
> >> -Michael Placentra II

>
> >> On Oct 4, 5:55 pm, "Jason" <JasonJa...@nospam.nospam> wrote:
> >>> But after adding this line of code:

>
> >>> <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />

>
> >>> I see a JavaScript error that says "'Sys' is undefined".

>
> >>> Is there something else I am not including. This is a web application
> >>> project, not a website project, if that makes a difference.

>
> >>> Thanks
> >>> Jason- Hide quoted text -

>
> - Show quoted text -


I had to do the same thing for adding ajax to my first project a few
weeks ago!!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding AJAX to an existing app dgk Microsoft ASP .NET 1 16th Jun 2007 12:36 AM
Using ajax in Existing ASP.net Application Mukesh Microsoft ASP .NET 5 12th Jun 2007 07:52 AM
Adding ASP.NET AJAX to an existing project trullock@hotmail.com Microsoft ASP .NET 2 23rd Feb 2007 04:33 PM
Adding automation to existing MFC application maol Microsoft VC .NET 1 11th Mar 2005 11:22 AM
Adding Remoting to Existing Application Lucas Tam Microsoft VB .NET 1 9th Nov 2004 09:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 AM.