Add and show Event registration webpart on pages other than Event page

Apun Sehgal asked on November 5, 2014 07:53

I have a requirement where I have a Main Location Page(/site/locationdetail.aspx?locationid=loc1), on which I have to show events specific to that Location, along with other information (Webparts) specfic to that Location. I am using out of the Box Event Booking System pagetype to store the events and have added a repeater on location page to list these events. I have also added Event registration webpart on the same page. So on click of RSVP button i want the registration webpart to open on the same page(/site/locationdetail.aspx?locationid=loc1). But it does not happen. But when i change the RSVP button url to event page(/site/events/event1.aspx) the form opens up.

Because i want user to stay on the same page, is there a way i could do that without driving the user away to another page.

Recent Answers


Virgil Carroll answered on November 5, 2014 18:01

Your going to have to tie the registration webpart to a SQL query and actually query from the data structure what you want to use. The reason it works going to the page is the data is there in the page structure already. When you do this from another location you have to tell the webpart how to bind the data. You could do this through a datasource and tie that to your QueryString, or a SQL query in the backend of the webpart itself.

Since you are using a QueryString there is really no good way to do this using a path to a page.

0 votesVote for this answer Mark as a Correct answer

Apun Sehgal answered on November 6, 2014 14:57

In the configuration of Event Registration webpart, I could not find any proprty/zone where I could bind any query or datasource. What I have tried (But didnt work): On click of RSVP button I redirect the page to same page with additional parameter as EventId. Also I have added a data source that filters the data(Event Page) based on EventId from query string. After redirecting/reloading the page the event registration webpart doesn't show up.

Any suggestion would really help

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on December 6, 2014 11:24

Hi,

You need to customize the web part - best way to create a clone and modify this clone to avoid issues when upgrading or hotfixing. In the code behind of the web part (\CMS\CMSWebParts\EventManager\EventManager.ascx.cs) there is a check for the page type made:

if (StopProcessing || DocumentContext.CurrentDocument == null || DocumentContext.CurrentDocument.NodeClassName.ToLowerCSafe() != "cms.bookingevent")
        {

So, you need to modify this condition.

Best regards,
Juraj Ondrus

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.