This is a migrated thread and some comments may be shown as answers.

RadAlert does nothing?

2 Answers 353 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rob Ainscough
Top achievements
Rank 1
Rob Ainscough asked on 21 Sep 2018, 06:20 PM

I've search thru all the thread regarding RadAlert not working and I still can't figure out why I get nothing at all, no errors in code, no exceptions triggered, nothing.

Here is my code:

<telerik:RadScriptManager ID="rsmLogin" runat="server" EnableHandlerDetection="false" EnableScriptCombine="false"></telerik:RadScriptManager>
<telerik:RadSkinManager ID="rskmLogin" runat="server" Skin="Default"></telerik:RadSkinManager>
<telerik:RadInputManager ID="rimLogin" runat="server"></telerik:RadInputManager>
<telerik:RadWindowManager ID="rwmLogin" runat="server" EnableShadow="true"></telerik:RadWindowManager>
<script type="text/javascript">
    function callBackFn(arg)
    {
        alert("this is the client-side callback function. The RadAlert returned: " + arg);
    }
</script>
 
<telerik:RadPageLayout ID="rpl_Login" runat="server" GridType="Fluid" Width="248px" Style="margin:2px; align-content:center;">
    <Rows>
        <telerik:LayoutRow style="height:42px; margin-top:8px">
            <Columns>
                <telerik:LayoutColumn style="text-align:center; align-content:center">
                    <telerik:RadButton ID="rbn_SignIn" runat="server" Text="SIGN IN" Font-Size="Large" Width="100"></telerik:RadButton>
                </telerik:LayoutColumn>
            </Columns>
        </telerik:LayoutRow>
    </Rows>
</telerik:RadPageLayout>

 

and code behind 

Private Sub rbn_SignIn_Click(sender As Object, e As EventArgs) Handles rbn_SignIn.Click
 
    Try
 
            Me.rwmLogin.RadAlert("We're sorry, but we could not locate your account based on the credentials provided.", 500, 200, "Login Error", "callBackFn")
 
    Catch ex As Exception
 
        Dim ErrorLog As New DC.Errors.Log(ex)
 
    End Try
 
End Sub

 

I also tried without the callBackFn which was pulled direction from your documentation sample.

Any suggestions?

Cheers, Rob.

 

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 21 Sep 2018, 06:27 PM
Hi Rob,

The problem with this snippet is in the apostrophe in the server code that terminates the JavaScript string too early and causes exceptions on the client side that you can monitor in the browser console. The solution is to escape it: https://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/calling-the-predefined-dialogs-from-the-server-methods.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Rob Ainscough
Top achievements
Rank 1
answered on 21 Sep 2018, 06:46 PM

Oh my goodness, you are correct, sorry I missed that apostrophe.  Working well now.

Cheers, Rob.

Tags
Window
Asked by
Rob Ainscough
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Rob Ainscough
Top achievements
Rank 1
Share this question
or