Using Notification similar to the pop-out message "Is this article helpful?"

1 Answer 41 Views
Ajax Notification
Peter
Top achievements
Rank 1
Peter asked on 03 Jul 2024, 05:15 PM

Telerik has the little Kendo ninja fellow as a constant icon on the bottom right of the window, and after a few seconds, it slides out to ask "Is this article helpful?  Yes/No".

My client wants a timed pop-out similar to that on each page, which after 10-15 seconds asks "Do you want more information?  Click here to contact us!" and then redirect to our contact page.  Or they can click to make it hide away (until the next page).

I'm suspecting the Notification widget will do this, but I'm not sure where to begin or if there is something better for this purpose.  Has anyone done something like this?

1 Answer, 1 is accepted

Sort by
0
Vasko
Telerik team
answered on 04 Jul 2024, 11:25 AM

Hi Peter,

To achieve the desired functionality, the RadNotification control is indeed a suitable choice. You can configure it to display a message after a certain delay and provide options for the user to either be redirected to a contact page or dismiss the notification. Here's a step-by-step guide to help you set this up:

  1. Add the RadNotification Control: Place the RadNotification control on the ASP.NET page and configure its properties to match your requirements.

  2. Set Up the Notification Content: Customize the content of the notification to include a message and buttons for the user to interact with.

  3. Handle User Interaction: Implement client-side event handlers to manage user interactions, such as redirecting to the contact page or dismissing the notification.

Here's an example code snippet to illustrate this:

<telerik:RadNotification ID="radNotification" runat="server" AutoCloseDelay="0" KeepOnMouseOver="true"
    Position="BottomRight" Width="300px" Height="150px" ShowCloseButton="true" OnClientHidden="onNotificationHidden">
    <ContentTemplate>
        <div style="text-align: center;">
            <p>Do you want more information?</p>
            <telerik:RadButton runat="server" ID="RadButton1" Text="Click here to contact us!" AutoPostBack="true" OnClientClicked="onClientClicked" />
        </div>
    </ContentTemplate>
</telerik:RadNotification>
setInterval(() => {
    var notification = $find("<%= radNotification.ClientID %>");

        if (notification && !notification.isVisible()) {
            notification.show();
        }
    }, 10000)

// Function to redirect to the contact page
function onClientClicked(sender, args) {
    window.location.href = '/contact';
}

// Function to handle notification hidden event
function onNotificationHidden(sender, args) {
    // Logic to handle when the notification is hidden (if any)
}

    Please refer to the following articles for additional information:

    Regards,
    Vasko
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Peter
    Top achievements
    Rank 1
    commented on 04 Jul 2024, 02:50 PM

    Thank you Vasko!  This is perfect, and exactly what I was looking for.
    Tags
    Ajax Notification
    Asked by
    Peter
    Top achievements
    Rank 1
    Answers by
    Vasko
    Telerik team
    Share this question
    or