I may be going about this incorrectly so feedback is welcomed. A large base of .ascx usercontrols would like to be included in a Umbraco 6.1.1 web. The rendering mode is mvc so no problems rending the macro and displaying what is on the control and executing actions when the buttons on the controls exist.
@Umbraco.RenderMacro("MyCustomControl")
The issue I have is that MyCustomControl has public routines that are exposed such as SaveData. The control has no buttons because in the previous application the parent page would call those events. The aspx.cs call would be like
if (valid) this.MyCustomControl1.SaveData();
myId = this.MyControl.ResourceId; // Id of the saved data, -1 otherwise
...
How can I call these routines in a MVC page? I may have multiple controls on one page and would like to have a single submit button for them as well.
I don't have the resources at this time to convert all the controls before launching. Can someone advise the way to execute routines in a usercontrol using a Umbraco template/cshtml file?
The initial Umbraco site is MVC and is stable. The next phase is migrating the functionality of a previous non Umbraco site to this new Umbraco site. I have no problem updating the user controls to MVC, I just don't think it can all be done before migrating for launch.
Execute usercontrol routine from cshtml.
I may be going about this incorrectly so feedback is welcomed. A large base of .ascx usercontrols would like to be included in a Umbraco 6.1.1 web. The rendering mode is mvc so no problems rending the macro and displaying what is on the control and executing actions when the buttons on the controls exist.
The issue I have is that MyCustomControl has public routines that are exposed such as SaveData. The control has no buttons because in the previous application the parent page would call those events. The aspx.cs call would be like
How can I call these routines in a MVC page? I may have multiple controls on one page and would like to have a single submit button for them as well.
I don't have the resources at this time to convert all the controls before launching. Can someone advise the way to execute routines in a usercontrol using a Umbraco template/cshtml file?
Can I ask why you are switching to MVC when you have a large base of usercontrols that depend on masterpages calling routines?
Wouldn't it be better to use the webforms engine instead ?
The initial Umbraco site is MVC and is stable. The next phase is migrating the functionality of a previous non Umbraco site to this new Umbraco site. I have no problem updating the user controls to MVC, I just don't think it can all be done before migrating for launch.
is working on a reply...