Hello again,
I'm having some trouble getting DI to work on a user control. It seems much the same as this thread: http://forum.springframework.net/showthread.php?t=1542 but I've tried everything on there and no luck so far.
I'm extending Spring.Web.UI.UserControl for my control. I'm using ASP.NET 2.0 with master pages. I've changed my masterpages to extend Spring.Web.UI.MasterPage and each page now extends Spring.Web.UI.Page.
My custom control is used in the Master.master masterpage like so:
I have the tag defined in Web.config as:Code:<%@ Master Language="C#" AutoEventWireup="true" Inherits="index" Codebehind="Master.master.cs" %> <!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"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link rel="stylesheet" type="text/css" href="~/assets/css/site.css" /> <script type="text/javascript" src="<%# ResolveUrl("~/assets/js/common.js") %>"></script> <title>iLogistics master page</title> </head> <body> <form id="pageForm" runat="server"> <asp:ScriptManager ID="ajaxScriptManager" runat="server" /> <div id="container"> <div id="top-links"><iLogistics:LoggedIn ID="currentUser" runat="server" />...........
My pages xml file follows this design:Code:<add tagPrefix="iLogistics" tagName="LoggedIn" src="~/controls/user/LoggedIn.ascx" />
Finally, my control is defined as:Code:<object id="basePage" abstract="true"> <property name="MasterPageFile" value="~/masterPages/Master.master" /> </object> <object id="basePopup" abstract="true"> <property name="MasterPageFile" value="~/masterPages/PopUp.master" /> </object> <object type="~/index.aspx" parent="basePage"></object> <!-- About pages --> <!-- Customer pages --> <object type="~/Customers/addCustomer.aspx" parent="basePage"> <property name="CustomerManager" ref="CustomerManager" /> </object>
I think thats everything but I still cannot make it work. Oh yeah and I'm using the SpringHibernate12 version of Spring from the most recent nightly build.Code:<object id="iLogistics.Web.Controls.User.LoggedIn" abstract="true"> <property name="UserManager" ref="UserManager" /> </object>
Many thanks if you are able to help.
Cheers
Stephen


Reply With Quote