Home Search Member List Faq Register Login  
UltimateSpellMVC
Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"

Thread Starter: gauri.rane   Started: 11-21-2012 2:35 AM   Replies: 5
 Karamasoft Support Forums » General Discussions » UltimateSpellMVC » Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"
 Printable Version    « Previous Thread   Next Thread »
  21 Nov 2012, 2:35 AM
gauri.rane is not online. Last active: 3/1/2013 4:56:50 AM gauri.rane

Top 10 Posts
Joined on 10-12-2012
Posts 17
Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"
Hi,
I am bulding an application in ASP.NET MVC 4.0 & my requirement for a particular page is to work spell check button in popup window. My application was working well when i used normal SpellChecker code in an application. The code is as below:

@(Html.UltimateSpellMVC()
.AutoCorrect(true)
.CapitalizeFirstLetterOfSentences(true)
.SpellAsYouType(true)
.SpellButton(sb => sb
.Height(25)
.Width(25)
.Type(Karamasoft.WebControls.UltimateSpell.SpellButtonType.ImageButton)
.ImageUrl("Images/SpellCheck-small.png")
.ImageAlign(System.Web.UI.WebControls.ImageAlign.Baseline))
.CustomDictionary("CustomEnglish")
.ShowAddButton(true)
.ShowOptions(true)
.ControlIdsToCheck("txtComments")
//.Dictionary("de-DE")
//.Language("German")
.Render())

But when i used css class for a button it throws an alert that "Microsoft Office Must be installed to check grammer" The code i have written is:


<a class="spellChkBtn">
@if (control.HasSpellchecker)
{
@(Html.UltimateSpellMVC()
.ID(control.spellId)
.SpellAsYouType(true)
.IgnoreHtmlTags(true)
.SpellButton(sb => sb
// .Height(25)
// .Width(25)
.Type(Karamasoft.WebControls.UltimateSpell.SpellButtonType.ImageButton)
.ImageUrl("")
.ImageAlign(System.Web.UI.WebControls.ImageAlign.Baseline))

.CustomDictionary("CustomEnglish")
.ControlIdsToCheck(control.Id)
.ShowAddButton(true)
.ShowOptions(true)
.ShowGrammarButton(false)
.Render())
}
</a>

The CSS i have used for "spellChkBtn" is:

.spellChkBtn span {
background:url(../../Images/desktop/iconSprite.png) no-repeat -31px -19px;
width:18px;
height: 18px;
margin: 0.3em 0 0 0.3em;
margin: 0.3em 0 0 0\9;
display:inline-block;
position:absolute;
}
.spellChkBtn {
display: inline-block;
height: 19px;
margin: 0 0 0 0.5em;
padding: 0 0 0.1em 0.4em;
width: 40px;
position:absolute;
right:10px;
z-index:11;
}
.spellChkBtn span, .spellChkBtn span:hover{
background: url(../../Images/desktop/iconSprite.png) no-repeat -4px -58px #EEE;
width: 34px;
height: 12px;
padding: 0;
margin: 0.3em 0 0 0.3em;
position:relative;
border-top:0;
}
.spellChkBtn span span, .spellChkBtn span span+span, .spellChkBtn span span:hover, .spellChkBtn span span+span:hover {
background:none;
margin: 0;
position:absolute;
}
a.spellChkBtn input{ display: none;}

Pls Help me out of this problem.

Thanks in advanced,
Gauri Rane

  
  21 Nov 2012, 11:10 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"

Spell and grammar check buttons are rendered as SPAN elements and it seems that your CSS classes override the default SPAN behavior for spellCheckBtn class.

By looking at your code, you seem to be trying to display your own image instead of the default Spell Check button. Please refer to the Client API sample to see how you can achieve this. You need to basically set ShowSpellButton to False and call the ShowSpellDialog client-side API method on the client-side when your custom image is clicked. You shouldn't wrap the UltimateSpellMVC control in an anchor element with a CSS class attached to it.

@(Html.UltimateSpellMVC()
   .ID(
"UltimateSpellMVC1")
   .ShowSpellButton(
false)
   .Render())

<input
   
type="image" 
   id="SpellCheckButton" 
   name="SpellCheckButton" 
   src="/Content/images/UltimateSpell.bmp" 
   alt="Spell Check" 
   onclick="UltimateSpells['UltimateSpellMVC1'].ShowSpellDialog();return false;" />


  
  21 Nov 2012, 10:18 PM
gauri.rane is not online. Last active: 3/1/2013 4:56:50 AM gauri.rane

Top 10 Posts
Joined on 10-12-2012
Posts 17
 Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"
Hi ,

Thank you for your quick response. But my problem is I dont want grammer check option to come. For that I have'nt gave any option like .ShowGrammarButton(true).
I understand problem occures bcoz of css. But now i just dont want that grammmer option to come..
There is one solution to hide the 2nd span by using code :
$('.spellChkBtn span:nth-child(2)').css('display', 'none');

But in this the problem is It is not hiding the last elements span.

Please advice me for this

Thanks in advance
Gauri Rane

  
  22 Nov 2012, 12:32 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"

UltimateSpellMVC renders the following SPAN elements for the spell check and grammar check onclick event handlers for client-side API functionatily regardless of whether you show/hide the buttons:

<span id="ctl01"><span onclick=UltimateSpell_OnClick('/MVCSuiteSample/UltimateSpellInclude/UltimateSpell.spell.htm?cid=ctl01','uc4e37a2a13ef4d5badebf00a2a2039dc',false);return false;"></span><span onclick=UltimateSpell_OnClick('/MVCSuiteSample/UltimateSpellInclude/UltimateSpell.grammar.htm?cid=ctl01','u72b7f3676c314d04983106bf8d81b83b',false);return false;"></span></span>

Your CSS style definitons seem to be overriding the default behavior of UltimateSpellMVC.

As we mentioned in our previous reply, you can't wrap the UltimateSpellMVC control inside an anchor element and manipulate the style of the anchor element and its child SPAN elements the way you are currently doing. You should follow the client-API sample to customize the spell check button.


  
  22 Nov 2012, 9:34 PM
gauri.rane is not online. Last active: 3/1/2013 4:56:50 AM gauri.rane

Top 10 Posts
Joined on 10-12-2012
Posts 17
Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"
Hi,

Is there any other method to hide that grammer's span. So that it will chek for only spelling and not grammer?

Thanks in advanced
Gauri Rane

  
  22 Nov 2012, 11:16 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"
There is no other method. If you don't apply those CSS classes, you should be fine by setting the ShowGrammarButton property to False, which is the default.
  
 Page 1 of 1 (6 items)
Karamasoft Support Forums » General Discussions » UltimateSpellMVC » Re: Spell Checker is showing an alert "Microsoft Office Must be installed to check grammer"

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.