I've a small address box (usercontrol), which is repeated across the site but depending on the page layout, the address box will appear in a different positions. To save the content editor having to update duplicate versions of the address box, I thought a usercontrol would be the best approach.
From Umbraco, the macro has been added to the homepage template. Properties have been added to the DataType, so that the usercontrols fields can be updated via the homepage.
This approach works fine on the home page, but not on any other pages, where the default property values are loaded from the usercontrol.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text;
namespace companyAddress { public partial class companyAddress : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) {
if (!Page.IsPostBack) { addresslbl.Text = _address; telephonelbl.Text = _telephone;
As you can see there's not much to the usercontrol. If possible I would like to update the default fields in the usercontrol, from the home page. And then within each content page template, add the usercontrol as normal using:
Update usercontrol values
Hi All
I've a small address box (usercontrol), which is repeated across the site but depending on the page layout, the address box will appear in a different positions. To save the content editor having to update duplicate versions of the address box, I thought a usercontrol would be the best approach.
From Umbraco, the macro has been added to the homepage template. Properties have been added to the DataType, so that the usercontrols fields can be updated via the homepage.
This approach works fine on the home page, but not on any other pages, where the default property values are loaded from the usercontrol.
As you can see there's not much to the usercontrol. If possible I would like to update the default fields in the usercontrol, from the home page. And then within each content page template, add the usercontrol as normal using:
Any advice or pointers would be greatly appericated.
Umbraco Version:4.0.4.2
IIS 7
Asp.Net 3.5
Thanks
Eddie
Hi All
All sorted, but just in case anyone needs a similar solution,
Just need to update the properties in the Macro, to recursive:
Then added the above to each content template : -)
Thanks
Eddie
is working on a reply...