We have moved to GitHub Issues
You are viewing the read-only archive of Umbraco's issue tracker. To create new issues, please head over to GitHub Issues.
Make sure to read the blog posts announcing the move for more information.
Created by Rick Mason 06 Nov 2013, 16:40:12 Updated by Rick Mason 11 Nov 2013, 10:00:54
I have created an ASCX file and saved it in the ~/usercontrols folder, with its DLL in the ~/bin folder. I create a macro and specify ~/usercontrols/Example.ascx in the Macro Properties > usercontrol box. I can add this macro to a template and it works.
The code-behind for the ASCX has a public property defined as:
public string ExampleProperty { get; set; }
The ASCX file itself has the following line:
<%= ExampleProperty %>
I click on my macro and go to the Parameters tab. I create a parameter as follows:
Alias: ExampleProperty Name: Example Type: Textbox
On my template I add the the macro using the toolbar, and am prompted for a value for the "Example" property. It inserts this line in the template:
@Umbraco.RenderMacro("ExampleUsercontrol", new )
However when the page is rendered, ExampleProperty on the ASCX usercontrol is an empty string. It has not received the value from the Umbraco template.
@Rick, I'm assuming that this works fine in 6.x ?
Yes. I don't have a working 6.0 setup at the moment, but I used 6.0 on the L2 training course recently and the workbook shows we followed these steps. The only difference was we used the WebForms engine and converted to MVC later.
I've just installed Umbraco v6.1.6 using exactly the same setup and test code. Yes, it works.
Thanks rick! Will have this fixed today.
Fixed in revs: a311a54d3d477ed56eb59cb59feaad85d949c174, 6fe647146c6126a425f79fe346a50a0c17b003c2
Thanks for finding this, would have caused some headaches :)
Brilliant, thank you!
Priority: Normal
Type: Bug
State: Fixed
Assignee: Shannon Deminick
Difficulty: Normal
Category:
Backwards Compatible: True
Fix Submitted:
Affected versions: 7.0.0
Due in version: 7.0.0
Sprint:
Story Points:
Cycle: