Customizing the Event Registration widget
I've downloaded and implemented the Event Registration widget from the Marketplace, and everything works well. However, I would like to modify the FormsControl.ascx file to add some CSS and include a title. Unfortunately, no changes I make in that file appear to be having any effect. I have rebuilt and ensured the updated EventRegistration.dll file is in my web project's bin folder, but the layout does not include my changes.
Am I missing a step to ensure that the .ascx file updates are properly embedded in the build?
Hello Josh,
Did you still experience the issue?
I have register and test this widget and the updates seems to works fine. What I have done is to:
- Make changes in the EventsRegistration\Resources > .ascx file
- Build the solution
- Copy and Replace the newly generated 'EventsRegistration.dll' file
from: Events Registration project Bin folder
to: SitefinityWebApp Bin folder.
Regards,
Svetoslav Manchev
Telerik
Yes, I'm still experiencing the issue. I am updating the dll properly, but for some reason the changes to the ascx file are not being utilized. Here's my ascx file (note the added title panel):
<%@ Control Language=
"C#"
%>
<%@ Register TagPrefix=
"sfFields"
Assembly=
"Telerik.Sitefinity"
Namespace=
"Telerik.Sitefinity.Web.UI.Fields"
%>
<%@ Register TagPrefix=
"sf"
Namespace=
"Telerik.Sitefinity.Web.UI"
Assembly=
"Telerik.Sitefinity"
%>
<sfFields:FormManager id=
"formManager"
runat=
"server"
/>
<asp:Panel ID=
"errorsPanel"
runat=
"server"
CssClass=
"sfErrorSummary alert alert-danger"
/>
<sf:SitefinityLabel id=
"successMessage"
runat=
"server"
WrapperTagName=
"div"
HideIfNoText=
"true"
CssClass=
"sfSuccess"
/>
<asp:Panel runat=
"server"
ID=
"formTitle"
><h2>Register
for
this
Event</h2></asp:Panel>
<asp:Panel ID=
"formControls"
runat=
"server"
>
</asp:Panel>
Hi Josh,
The amendments could be done in the .ascx file of the designer. The widget will show on the frontend the selected Form only. The page style and design could be done by adding this widget on a predefined Page Template or by adding widgets you need directly on that page (for example Content Block, Image, etc.). This will allows you to manage the Page content more flexible.
In addition, in the 'How to Install' video of the Events Registration Widget is shown how the widget could be set-up and used.
Regards,
Svetoslav Manchev
Telerik
I would encourage you to try it. Create a new solution, add and reference the Events Registration project, then make a cosmetic change to the ascx file in question -- add a title or something. Build and test. If you don't get the same results then there must be something in my environment.
Incidentally, I added the widget then modified the code because the scenario you describe -- using content blocks -- isn't optimal. Not all events require registration, so I have added a boolean custom field indicating whether the Event Registration widget should be displayed. As a result, I need to be able to hide the entire thing, title and all. That's what prompted the modification.
In any case, I have worked around it in another way. Rather than modify the ascx, I have to manipulate the controls collection in the codebehind in order to add my headline and manipulate the CSS classes assigned to the components. I wouldn't say this "solves" the problem, it just gets at it via another route.
Hello Josh,
In order to use the FormsControl.ascx file please do the following:
- set the file as embedded resource under FormsControl.ascx properties.
- In FormsControlCustom.cs update:
> Correct the path to the file (if needed) under:
private const string layoutTemplateName = "FormsNotification.Resources.FormsControl.ascx";
public
override
string
LayoutTemplatePath
get
string
str;
str = (!
string
.IsNullOrEmpty(
base
.LayoutTemplatePath) ?
base
.LayoutTemplatePath : FormsControl.layoutTemplatePath);
return
str;
set
base
.LayoutTemplatePath = value;