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

RadSpell in RadWindow causes error

3 Answers 20 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Gregory
Top achievements
Rank 1
Gregory asked on 06 Jan 2014, 06:07 PM
Here are my initial steps:

1) Create a fresh .NET 4.5 "ASP.NET Web Forms Application" in Visual Studio 2012
2) Upgrade the project to a Telerik RadControld project, using v 2013.3.1015.45
3) Place the following markup on Default.aspx:

<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="RadSpellTestApp._Default" %>
 
<asp:Content runat="server" ID="HeaderContent" ContentPlaceHolderID="HeadContent" >
 
    <script type="text/javascript">
        function spellCheck(elID) {
            var spell = $find(elID);
            spell.startSpellCheck();
            return false;
        }
    </script>
 
</asp:Content>
 
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    
    <asp:Button ID="btnOpen" runat="server" Text="Open Window" />
 
    <trk:RadWindow ID="rdwElement" runat="server" Behaviors="Move,Resize" Width="525" Height="390" Modal="true" VisibleStatusbar="false" >
        <ContentTemplate>
 
            <trk:RadAjaxPanel ID="pnlElement" runat="server">
                             
                <trk:RadTextBox ID="txtText" runat="server" Rows="7" TextMode="MultiLine" Width="474px" />
                <trk:RadSpell ID="rdSpell" runat="server" ButtonType="None" ControlToCheck="txtText" />
                <asp:Image ID="imgSpell" runat="server" ImageUrl="~/Images/spellcheck.gif" Style="cursor: pointer;" ToolTip="Spell check" />
 
            </trk:RadAjaxPanel>
         
            <br />
            <asp:Button ID="btnClose" runat="server" Text="Close Window" />
         
        </ContentTemplate>
    </trk:RadWindow>
 
</asp:Content>

This is the code-behind:

Public Class _Default
    Inherits Page
 
    Private Sub btnOpen_Command(sender As Object, e As CommandEventArgs) Handles btnOpen.Command
        rdwElement.VisibleOnPageLoad = True
    End Sub
 
    Protected Sub btnClose_Command(ByVal sender As Object, ByVal e As CommandEventArgs) Handles btnClose.Command
        rdwElement.VisibleOnPageLoad = False
    End Sub
 
    Protected Overrides Sub OnPreRender(e As EventArgs)
        MyBase.OnPreRender(e)
        imgSpell.Attributes("onClick") = "spellCheck('" & rdSpell.ClientID & "')"
    End Sub
 
End Class


If I open and then immediately close the RadWindow, I don't get any errors. However, if I:

1) Open the Window
2) Spell-check the textbox.
3) Close the Window

I get a javascript error:

0x800a1391 - JavaScript runtime error: '$telerik' is undefined

This same setup did not cause me problems in .NET 4.0. I can send the corresponding .NET 4.5 .zip file if necessary. Thank you!

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Jan 2014, 01:03 PM
Hello Gregory,

I just tried this and things seem to work fine for me. I am attaching here the files I used for testing and a short video from my test. Could you take a look and see if I am missing something? If my sample works on your end, does examining the differences between both cases help in resolving the situation? If not, can you post the modifications needed for me to observe the issue, so I can investigate it?

In the meantime you can try upgrading to the Q3 2013 SP1 version to see if this makes a difference.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Tony
Top achievements
Rank 1
answered on 29 Jan 2014, 05:45 PM
Same issue - slightly different starting point...

Just upgraded to the latest version of the ASP.NET tools and now I'm getting an unhandled exception every time I postback a page on the $telerik.$ = jQuery.noConflict(true); statement at the end of the dynamically generated ScriptResource.axd file.
0
Marin Bratanov
Telerik team
answered on 31 Jan 2014, 11:42 AM
Hello Tony,

I just tried that with the CDNs enabled and with postbacks on the form, yet no errors were thrown on my end. Could you take a look at my sample and the attached video to see if I am missing something?

In the meantime I can suggest that if you have other jQuery on the page, remove it and use our built-in: http://www.telerik.com/help/aspnet-ajax/introduction-using-jquery.html. You can simply assign our jQuery (the $telerik.$ variable) to the common window.$ variable.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Spell
Asked by
Gregory
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Tony
Top achievements
Rank 1
Share this question
or