Showing posts with label experiencing. Show all posts
Showing posts with label experiencing. Show all posts

Wednesday, March 28, 2012

AJAX breaks AdRotator control rendering

Hi,

Does anyone know how to resolve the issue I'm experiencing with AJAX breaking the AdRotator control?

My AdRotators reside in a master page and display fine until a AJAX UpdatePanel is introduced. Once an UpdatePanel is added the AdRotators start to render their HTML output at the very beginning of the page's HTML (before the

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
in my case).

Image without AJAX problem:http://x.yougodo.com/screenshot-good.jpg

Image with AJAX problem:http://x.yougodo.com/screenshot-bad.jpg

Any help would be greatly appreciated.

Cheers

I can't seem to find any other users with your issue. You may want to give this approach a try:http://www.seesharprun.net/2007/08/09/AnAdrotatorAlternative.aspx. Where is your AdRotator located on your MasterPage? I'm assuming you are adding your UpdatePanel inside the Master's ContentTemplate?

Perhaps you can post a small snippet of code that will replicate the issue?

-Damien


Hi Damien,

Thanks for your suggestion, much appreciated - I will take a look.

Was puzzled myself why no-one else seemed to have encountered the same problem?!?

The UpdatePanel is actually located in the *.aspx page rather than the *.master - I'll try and create a small example to re-create later as everything is too intertwined in my current project to post something useful.

P.S. The Google Ads in the screenshots are not in AdRotators, only the image ads you see.


How bizarre... I've not been able to recreate problem creating a simple AJAX / master page scenario?!?

Maybe it's down to some of my non-standard controls - all pages are inherited from my own Page class that adds a bunch of extra properties and methods useful for my project. The control triggering the AJAX callback is also my own roll-your-own page number selecting control.

Quite puzzled as both these own-code-rolled controls successfully use AJAX functionality on other pages. It's jut when the AdRotator is introduced that bizarre results occur. Quite puzzled!


That's interesting that you can't reproduce it. I think your assumption may be correct with your non-standard controls. Do you perhaps have an un-closed element or something? This could be causing some issues. You also may just want to make sure your AJAX environment is setup correctly, you can refer to these common problems/fixes:http://blogs.visoftinc.com/archive/2007/09/23/asp.net-ajax--updatepanel-not-working--common-problems.aspx.

Hope you find your problem!

-Damien


Hi Damien,

Cheers once again for your help - much appreciated. Doesn't seem to be any of the issues described in the link you gave though.

Very bizarre, the output would suggest that somehow the AdRotator is getting to render it's output before the *.master or *.aspx files do?!? No html at all is output to the locations where the AdRotator is placed, only at the top of the page before all other html. Very puzzling.

I've abandoned trying to find a solution for now, coding my own temporary random ad selector for now. The AdRotators were only ever going to be a temporary measure until a fully functioning ad management system is plugged in.

Gavin.

AJAX Beta 2 - Could not load type Microsoft.Web.UI.UpdateProgress from assembly Microsoft.

Hi...

I'm experiencing a problem with the new AJAX Beta 2. When I try and put the UpdateProgess on a simple page, I get the below

Could not load type 'Microsoft.Web.UI.UpdateProgress' from assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.TypeLoadException: Could not load type 'Microsoft.Web.UI.UpdateProgress' from assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Source Error:

Line 13: </head>
Line 14: <body>
Line 15: <form id="form1" runat="server">
Line 16: <div>
Line 17:


Source File:C:\Inetpub\wwwroot\Auction\TEST.aspx Line:15

Stack Trace:

[TypeLoadException: Could not load type 'Microsoft.Web.UI.UpdateProgress' from assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
ASP.test_aspx.__BuildControlform1() in C:\Inetpub\wwwroot\Auction\TEST.aspx:15
ASP.test_aspx.__BuildControlTree(test_aspx __ctrl) in C:\Inetpub\wwwroot\Auction\TEST.aspx:1
ASP.test_aspx.FrameworkInitialize() in C:\Inetpub\wwwroot\Auction\TEST.aspx.vb:912307
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +40
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.test_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

For the below code

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %
<%@dotnet.itags.org. Register Assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="Microsoft.Web.UI" TagPrefix="asp" %><!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdateProgress id="UpdateProgress1" runat="server">
<progresstemplate>
<IMG src="Template/loading.gif" /> Working ... <asp:Image id="LoadingImage" runat="server" ImageUrl="Template/loading.gif"></asp:Image>
</progresstemplate>
</asp:UpdateProgress>
<asp:UpdatePanel id="UpdatePanel1" runat="server">
</asp:UpdatePanel>
</div
</form>
</body>
</html>
Please can you help, this is driving me nuts...Wink

Thanks,
Clint

Clint,

Did you try to add the assemby reference to the web.config file? You don't need to register it in the page, and you don't need it in the BIN folder.
Also, it seems that your copy of the assembly is still Beta 1, have you uninstalled Beta 1 and, then, reinstalled Beta 2? That will install the correct assembly in the GAC.

Cheers,

Juan


Hi Juan, thanks for your help.

I've uninstalled the Beta 2 and reinstalled a fresh copy from the internet, and I've also deleted the files in the BIN directory and the reference in the .aspx page.
In addition, I've replaced my web.config with the one that is created from a new web project including AJAX (I've included it below) But I am still getting this error.

Server Error in '/Auction' Application.

Could not load type 'Microsoft.Web.UI.UpdateProgress' from assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.TypeLoadException: Could not load type 'Microsoft.Web.UI.UpdateProgress' from assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Source Error:

Line 8: </head>
Line 9: <body>
Line 10: <form id="form1" runat="server">
Line 11: <div>
Line 12: <asp:ScriptManager id="ScriptManager1" runat="server">


Source File:C:\Inetpub\wwwroot\Auction\Default2.aspx Line:10

Stack Trace:

[TypeLoadException: Could not load type 'Microsoft.Web.UI.UpdateProgress' from assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
ASP.default2_aspx.__BuildControlform1() in C:\Inetpub\wwwroot\Auction\Default2.aspx:10
ASP.default2_aspx.__BuildControlTree(default2_aspx __ctrl) in C:\Inetpub\wwwroot\Auction\Default2.aspx:1
ASP.default2_aspx.FrameworkInitialize() in C:\Inetpub\wwwroot\Auction\Default2.aspx.vb:912307
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +40
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default2_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Here is my code...

<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %><!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdateProgress id="UpdateProgress1" runat="server">
<progresstemplate>
<IMG src="Template/loading.gif" /> Working ... <asp:Image id="LoadingImage" runat="server" ImageUrl="Template/loading.gif"></asp:Image>
</progresstemplate>
</asp:UpdateProgress>
<asp:UpdatePanel id="UpdatePanel1" runat="server">
</asp:UpdatePanel>
</div
</form>
</body>
</html>

And here is my new web.config

<configuration>
<configSections>
<sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="Microsoft.Web.Configuration.ScriptingSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="webServices" type="Microsoft.Web.Configuration.ScriptingWebServicesSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="Microsoft.Web.Configuration.ScriptingJsonSerializationSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<section name="profileService" type="Microsoft.Web.Configuration.ScriptingProfileServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
<section name="authenticationService" type="Microsoft.Web.Configuration.ScriptingAuthenticationServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<connectionStrings>
<remove name="AuctionConnectionString"/>
<add name="AuctionConnectionString" connectionString="Data Source=ALEPPO;Initial Catalog=Auction;Persist Security Info=True;User ID=sa;Password=" providerName="System.Data.SqlClient"/>
<add name="SMSINTv2ConnectionString" connectionString="Data Source=ALEPPO;Initial Catalog=SMSINTv2;Persist Security Info=True;User ID=sa;Password=" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagPrefix="asp" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CompareValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CustomValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RangeValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RegularExpressionValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RequiredFieldValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Microsoft.Web.UI.Compatibility.ValidationSummary, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</tagMapping>
</pages>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
--><compilation debug="true">
<assemblies>
<add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
</httpHandlers>
<httpModules>
<add name="WebResourceCompression" type="Microsoft.Web.Handlers.WebResourceCompressionModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptModule" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
<microsoft.web>
<scripting>
<webServices>
<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
<!--
<jsonSerialization maxJsonLength="500">
<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
</jsonSerialization>
-->
<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
<!--
<authenticationService enabled="true" requireSSL = "true|false"/>
-->
<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
and modified in Atlas applications, you need to add each property name to the setProperties and
getProperties attributes. -->
<!--
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
--></webServices>
</scripting>
</microsoft.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler"/>
</handlers>
</system.webServer>
</configuration>

Hi...

I've managed to fix it thanks ...

I tried creating a new project and copying the files across to it, and it worked!? Very Strange!?

Any Idea why this would be, even after I copied the entire now working project files back to the original folder that wasn't working, it still did not work??

Thanks for your help,
Clint


I don't know if this helps any or not, but I was originally getting the same error and this is how i resolved it:

*I should first mention I had Beta1 and the ValueAdd CTP implemented prior to Beta2. (I had implemented them simply by copying the Microsoft.Web.Extensions.dll and Microsoft.Web.Preview.dll to the app's Bin folder):

To implement Beta2 I followed the doc instructions (web.config modification), and deleted the 2 dll's from the Bin folder (and removed the web.config references to the ValueAdd piece).

That's when I started getting the same error you were.

UNTIL I restarted IIS. I'm guessing it (or ASP.NET) had the old dll's cached somewhere since I originally had them in the bin folder??

Hope it helps-

Kenneth


The assemblies are in the GAC, cached, etc. Restarting IIS as suggested below worked for me too.