Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Guys,
I have made my custom macro parameter type which gives me an DropDown populated from a DB when adding the macro to a page but I'm struggling reading the value in code behind.
This code here:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
Node myNode = Node.GetCurrent();
foreach (var item in myNode.PropertiesAsList)
registerPopup.InnerHtml += item.Alias + " - " + item.Value + "<br />";
}
Generate following output:
bodyText - contentPanels - title - description - keywords - umbracoNaviHide - 0
Should not my custom parameter be in there?
If I view page source I see this:
macroAlias="ShowEvent" />
And its the value of eventselector I'm looking for!
Hi again,
I found the video http://umbraco.com/help-and-support/video-tutorials/introduction-to-umbraco/developer-introduction/macro-parameters.aspx that explained it all, I wish there was some better index showing an overview of the videos available as I struggle to find the ones I do look for.
Anyway I was using this property:
public int eventid
get { return event_id; }
set { event_id = value; }
If I changed it to
public string eventid { get; set; }
it all worked much better!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Retrieving custom Macro Parameter
Hi Guys,
I have made my custom macro parameter type which gives me an DropDown populated from a DB when adding the macro to a page but I'm struggling reading the value in code behind.
This code here:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Node myNode = Node.GetCurrent();
foreach (var item in myNode.PropertiesAsList)
{
registerPopup.InnerHtml += item.Alias + " - " + item.Value + "<br />";
}
}
}
Generate following output:
bodyText -
contentPanels -
title -
description -
keywords -
umbracoNaviHide - 0
Should not my custom parameter be in there?
If I view page source I see this:
macroAlias="ShowEvent" />
And its the value of eventselector I'm looking for!
Hi again,
I found the video http://umbraco.com/help-and-support/video-tutorials/introduction-to-umbraco/developer-introduction/macro-parameters.aspx that explained it all, I wish there was some better index showing an overview of the videos available as I struggle to find the ones I do look for.
Anyway I was using this property:
public int eventid
{
get { return event_id; }
set { event_id = value; }
}
If I changed it to
public string eventid { get; set; }
it all worked much better!
is working on a reply...