When I run this, the GetUnits fetchoperation does not run. If I comment out the ajaxscriptmanager, the GetUnits fetchoperation DOES run. I did try adding the individual script references for MicrosoftAjax.js, MicrosoftAjaxWebForms.js, etc., but that doesn't
change the outcome - still no data.
Can someone tell me what's wrong?!
As an FYI, I often have to clear out my temporary files (C:\windOWS\microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files) in order for the fetchoperation to start working again after I remove the ajaxscriptmanager element. In other words, I can start
with no ajaxscriptmanager, get data fine, add a ajaxscriptmanager and then, poof, no data. But when I go back and remove the ajaxscriptmanager, I have to clear out those temp files for the fetchoperation to start working again.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
As you could probably tell from the markup I included, I am using the <%@ register assembly="System.Web.Ajax"namespace="System.Web.UI"tagprefix="ajax" %>
element to register the "ajax" version of the scriptmanager; which is what I believe I need to do. The System.Web.Ajax version I am using is
3.0.31106.0.
Also, like I said in my original post, I DID override the default scripts and that didn't make a difference.
Also #2, everything works fine with the ajaxscriptmanager and the "ajax" scripts if everything is in the same page. This is only an issue if I move the scriptmanager to a master page.
How about one of the really knowledgable people copying my code and try to run it on your box? Should be easy enough to try.
I noticed that the datacontext seemed to get correctly created but it seemed the dataview was NOT being activated - even after I added sys:activate="*" to the body tag. So, I got this working by "hooking" up the dataview in the content page in the onReady
event to the datacontext object and then explicitly telling the dataview to fetch its data.
cgarland
Member
25 Points
14 Posts
Dataview stops populating when I place AjaxScriptManager in master page
Mar 17, 2010 07:11 PM|LINK
Here is my Master page:
When I run this, the GetUnits fetchoperation does not run. If I comment out the ajaxscriptmanager, the GetUnits fetchoperation DOES run. I did try adding the individual script references for MicrosoftAjax.js, MicrosoftAjaxWebForms.js, etc., but that doesn't change the outcome - still no data.
Can someone tell me what's wrong?!
As an FYI, I often have to clear out my temporary files (C:\windOWS\microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files) in order for the fetchoperation to start working again after I remove the ajaxscriptmanager element. In other words, I can start with no ajaxscriptmanager, get data fine, add a ajaxscriptmanager and then, poof, no data. But when I go back and remove the ajaxscriptmanager, I have to clear out those temp files for the fetchoperation to start working again.
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;" id="_mcePaste"><%@ master language="VB" codefile="MasterPage.master.vb" inherits="test.MasterPage" %><%@ register assembly="System.Web.Ajax" namespace="System.Web.UI" tagprefix="ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link rel="Stylesheet" type="text/css" href="styles/common.css" runat="server" />
</head>
<body id="body" runat="server" xmlns:sys="javascript:Sys" xmlns:dataview="javascript:Sys.UI.DataView">
<form id="frmTA" runat="server">
<ajax:ajaxscriptmanager id="sm" runat="server"></ajax:ajaxscriptmanager>
This is before the content
<br />
<asp:contentplaceholder id="ph" runat="server"></asp:contentplaceholder>
<br />
This is after the content
</form>
</body>
</html></div>
Zhi-Qiang Ni...
All-Star
33491 Points
2952 Posts
Microsoft
Re: Dataview stops populating when I place AjaxScriptManager in master page
Mar 22, 2010 10:28 AM|LINK
Hi cgarland,
Make sure your ScriptManager version is fit for the AJAX Library, if not, please override the default scripts by referring this:
http://www.asp.net/ajaxlibrary/HOW%20TO%20Use%20the%20Script%20Loader%20with%20the%20ScriptManager.ashx
Best regards,
Zhi-Qiang Ni
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
cgarland
Member
25 Points
14 Posts
Re: Dataview stops populating when I place AjaxScriptManager in master page
Mar 22, 2010 07:18 PM|LINK
As you could probably tell from the markup I included, I am using the <%@ register assembly="System.Web.Ajax" namespace="System.Web.UI" tagprefix="ajax" %> element to register the "ajax" version of the scriptmanager; which is what I believe I need to do. The System.Web.Ajax version I am using is 3.0.31106.0.
Also, like I said in my original post, I DID override the default scripts and that didn't make a difference.
Also #2, everything works fine with the ajaxscriptmanager and the "ajax" scripts if everything is in the same page. This is only an issue if I move the scriptmanager to a master page.
How about one of the really knowledgable people copying my code and try to run it on your box? Should be easy enough to try.
cgarland
Member
25 Points
14 Posts
Re: Dataview stops populating when I place AjaxScriptManager in master page
Apr 13, 2010 02:32 PM|LINK
Is there anyway to get help with issues like this without hoping/praying/wishing someone reads these posts and tries to offer help?
cgarland
Member
25 Points
14 Posts
Re: Dataview stops populating when I place AjaxScriptManager in master page
Apr 14, 2010 05:59 PM|LINK
I noticed that the datacontext seemed to get correctly created but it seemed the dataview was NOT being activated - even after I added sys:activate="*" to the body tag. So, I got this working by "hooking" up the dataview in the content page in the onReady event to the datacontext object and then explicitly telling the dataview to fetch its data.
dataviewInstance = $find("dataviewDIV");
dataviewInstance.set_dataProvider(dataContext);
dataviewInstance.fetchData(null, null, null, dataContext);
I hope this helps someone.