Potential bug in radspell

4 posts, 0 answers
  1. Ahmed Al-Asaad
    Ahmed Al-Asaad avatar
    4 posts
    Member since:
    Jun 2009

    Posted 24 Aug 2011 Link to this post

    I have the following requirement:
    • Radspell control to spell check a textbox
    • Radspell supports English and French languages
    • When an English user views the page, the English language is preselected from the dropdown, French language is selected otherwise

    I got the above working. However, when a French users enters purely English text in the textbox and select English from the drop down, the control still do the spell checking as if French is selected. I am using version 2011.1.519.40 and asp.net 4.0.

    I noticed that the issue occurs when only if I set the DictionryLanguage property

    Here is the code I have used
    Public Class _Default
        Inherits System.Web.UI.Page
     
        Dim language As String
     
     
        Protected Sub RadSpell1_Init(sender As Object, e As EventArgs) Handles RadSpell1.Init
            RadSpell1.SupportedLanguages = New String() {"en-us", "English", "fr-fr", "French"}
     
            If language = "1" Then
                RadSpell1.DictionaryLanguage = "fr-fr"
            Else
                RadSpell1.DictionaryLanguage = "en-us"
     
            End If
     
        End Sub
     
        Private Sub Page_PreInit(sender As Object, e As System.EventArgs) Handles Me.PreInit
            If Request.QueryString.AllKeys.Contains("lang") Then
                language = Request.QueryString("lang").ToString
            End If
        End Sub
    End Class

    <%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
        CodeBehind="Default.aspx.vb" Inherits="TelerikRadSpellPOC._Default" %>
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
        <h2>
            Welcome to ASP.NET!
        </h2>
        <div>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <telerik:RadSpell ID="RadSpell1" runat="server"  ControlToCheck="TextBox1"
                        />
     
        </div>
    </asp:Content>

    Please let me know if I missed anything
  2. Ahmed Al-Asaad
    Ahmed Al-Asaad avatar
    4 posts
    Member since:
    Jun 2009

    Posted 24 Aug 2011 Link to this post

    As a work a around I have done the following

    Private Sub RadSpell1_Init(sender As Object, e As System.EventArgs) Handles RadSpell1.Init
            If TLang = LanguageType.English Then
     
                RadSpell1.SupportedLanguages = New String() {"en-us", "English", "fr-fr", "French"}
               
            Else
     
                RadSpell1.SupportedLanguages = New String() {"fr-fr", "French", "en-us", "English"}
                
            End If
     
        End Sub
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ahmed
    Ahmed avatar
    1 posts
    Member since:
    Jul 2011

    Posted 27 Aug 2011 Link to this post

    It would be nice from the Telerik staff to let me know if I have done something wrong. I am the same person who posted the issue and I am using my work account which has the subscription instead of my personal
    Thanks
    A.
  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 30 Aug 2011 Link to this post

    Hello Ahmed,

    Yes, your code is fine and you can use it to achieve your scenario.

    Best regards,
    Rumen
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top