Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Missing ScriptResource.axd and inherited page base problem...

$
0
0

-------------------------
ASP.NET version: 2.0 using VB.NET
ASP.NET Ajax Extensions version:  1.0 (Final)
-------------------------

Hi,

I am trying to use the final release version (1.0) of the ASP.NET Ajax Extensions and I have a strange problem when I try to use the following code in my pages:

<asp:ScriptManager ID="ScriptManager1" runat="server">
    <Services>
        <asp:ServiceReference Path="~/WebServices/Ajax/SimpleService.asmx" />
    </Services>
</asp:ScriptManager>

The  3 <script> tags that should be rendered to the page (2 for ScriptResource.axd and 1 for WebServices/Ajax/SimpleService.asmx/jsdebug) are not appearing when the page loads into my browser. Everything else that the script manager is supposed to output appears:

<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$mainContent$ScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);
//]]>
</script>

Obviously this throws javascript errors because Sys.Whatever is not found - its in the missing js files.
 

Now this is where it gets a little weird...

The site is pretty complex, it uses dynamically assigned Master Pages (ie; they are specified at runtime and not design time) - each MasterPage inherits from a single master page base class. Each page in the site inherits from a single class called PageBase (which in turn inherits from System.Web.UI.Page) - its reasonably common to see a page base class like this that will perform routine tasks on every page of a website.

At first I thought my problem was related to using base classes and overriding certain page events ashas been mentioned in other posts on this forum. However, if I copy all the code from PageBase and paste it into a new class called AjaxTestPageBase and then make my page inherit AjaxTestPageBase instead of PageBase, everything works fine, all the neccessary code is rendered to the page and the test app works as expected. This rules out anything odd I may have been doing in the page base or in any of the Master Page setup.

Other than the name of the class, these 2 base class files are identical. One works, one doesn't.

Does anybody know why naming my page base class PageBase would cause the references to ScriptResource.axd not to appear in the final page?
 

 


 

 


Viewing all articles
Browse latest Browse all 5678

Trending Articles