Last post Aug 12, 2010 01:39 PM by Jerry Weng - MSFT
Aug 10, 2010 09:07 AM|ruskirpicik|LINK
Hello everybody! I'm beginner in AJAX, I would be happy if somebody can help me.
I was developing an ASP.Net Web-Site (MVS 2008, ASP.Net version 2.0.50727), so on current step I need pop-up windows with server code functionality. I decided to try AJAX.
I have downloaded the latest version AjaxControlToolkit.Binary.NET35, added dll to Bin folder, and writed code as:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
<asp:ScriptManager runat="Server" ID="ScriptManager1" />
<asp:Button ID="btnYes" runat="server" Text="Yes!" />
<asp:Panel ID="pnlModal" runat="server" CssClass="modalPopup" >
Modal Popup example
<asp:Button ID="btnClose" runat="server" Text="Close" />
<ajaxToolkit:ModalPopupExtender TargetControlID="btnYes" ID="pnlModal_ModalPopupExtender"
runat="server" DynamicServicePath="" Enabled="True" BackgroundCssClass="modalBackground"
PopupControlID="pnlModal" CancelControlID="btnClose" DropShadow="true" X="100"
I use ScriptManager coz I can't compile project with ToolkitScriptManager.
When I start web site I can't get the expected result, only I get script error message like "Object doesn't support property or method".
Aug 10, 2010 10:38 AM|integrasol|LINK
Is your Web site running as an ASP.NET v2.0 application? If so, you may want to set it to v3.5.
Aug 10, 2010 11:09 AM|ruskirpicik|LINK
Ok... I have checked properties on IIS server for web site, ASP.NET version is set to 2.0.50727.
And my project in MVS: Website -> Start option...-> Build -> Target Framework set to ".NET Framework 3.5".
Maybe I don't get something?
Aug 10, 2010 11:24 AM|integrasol|LINK
Ah yes, that certainly can be confusing; v2.0.50727 is the actual version, whereas the .NET Framework 3.5 (SP1) contains extensions to v2.0.50727.
Anyway, that bit looks good.
What does your web.config file look like? I'm really interested in how the Ajax assemblies are being registered.
Aug 10, 2010 11:39 AM|ruskirpicik|LINK
Hmm.. yes, propably I don't get smth. I didnt make any changes in web.congif manually. I've just added AjaxControlToolkit.dll via "Add Reference..." in VS.
So my web.config looks like:
Aug 10, 2010 11:59 AM|integrasol|LINK
Okay, that seems to be in order.
Anyway, I don't quite remember the actual properties for your version of the ModalPopupExtender, but if I were you, and you can't look it up, I would remove some of the properties from the HTML markup (making sure it compiles), and then find out which one
is the culprit.
Aug 10, 2010 12:05 PM|diptibhalla|LINK
use this instead of scriptmanager only then can your problem be solved.
Aug 10, 2010 12:14 PM|ruskirpicik|LINK
I can't compile with ToolkitScriptManager, I get error:
Unknown server tag 'asp:ToolkitScriptManager'.
Aug 10, 2010 12:17 PM|diptibhalla|LINK
You need to change the tag prefix...use <ajaxToolkit:ToolkitScriptManager ..
instead of <asp:ToolkitScriptManager
Aug 10, 2010 12:20 PM|ruskirpicik|LINK
Ok, I compiled, but got Server Error on start site:
"Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31bf3856ad364e35'"
Aug 10, 2010 12:27 PM|diptibhalla|LINK
what framework are you using coz the version of ajax toolkit you have added requires framework 3.5..If you are not using framework 3.5 then install a previous version of the toolki and use scriptmanager instead.
Aug 10, 2010 03:14 PM|integrasol|LINK
Do check out this thread, http://forums.asp.net/t/1273185.aspx
Aug 10, 2010 08:31 PM|luappy13|LINK
The reason you are getting this error is probably this.
When you include ScriptManager it loads the client .js framework scripts as built into the server control. However you are using server controls (Modal popup or whatever) that rely on the scripts and the objects present when you use ToolkitScriptManager.
To work around this you need to donwload the AjaxControlToolkit source files, isolate which .js scripts contain the methods/ objects required by that modal popup and add them to the build via a script reference.
I, for example, was attempting to call
when I had ToolkitScriptManager present. By referencing the Toolkit scripts 'MicrosoftAjax.js' and 'AuthenticationService.js' in my regular ScriptManager I could use the toolkit with a normal manager
Aug 12, 2010 02:57 AM|Jerry Weng - MSFT|LINK
Would you please send me the project to my email address. I have sent you my email address by private message.
Aug 12, 2010 12:55 PM|Jerry Weng - MSFT|LINK
I test your poject and modify some markups and make it work.
I suggest to follow the steps below.
1, look at the Solution Explorer in your Visual Studio 2008.
2, right-click the project name, WebApplication1, click "Add Reference...".
3, click Browser tab and choose the AjaxControlToolkit.dll(v3.5) and click ok.
4, open the page "default.aspx".
5, delete <asp:ScriptManager runat="Server" ID="ScriptManager1" />.
6, add <ajaxToolkit:ToolkitScriptManager ID="scriptmanager1" runat="server"></ajaxToolkit:ToolkitScriptManager>.
If you still get error, please create a new project to do the same steps above.
Aug 12, 2010 01:26 PM|ruskirpicik|LINK
I've followed these steps, project was built, but I get error when start default.aspx:
Aug 12, 2010 01:39 PM|Jerry Weng - MSFT|LINK
Make sure you had installed .NET Framework 3.5 SP1 .