Hi,
It is possible to log SpellChecker operations but it takes some extra coding to do that. SpellChecker relies on AJAX so does not post back the page, as such no server side event is raised. As a result, in order to catch and log spell checking event, you must catch it on the client side and then somehow notify your server side code to write the log.
In order to catch the event on the client side, you would need to trigger the SpellChecker’s with JavaScript instead of setting StartButton. It will be something like this:
Code: HTML/ASPX
<input type="button" value="Spell Check" onclick="spellcheck()" />
Here “spellcheck” is your own JavaScript function and you would call our client side JavaScript interface to start the spell checker inside this function. for example, it can be something like this:
Code: JavaScript
function spellcheck()
{
//report this to the server side….
…..
//trigger the spell checker
eo_GetObject("SpellChecker1").start();
}
This should start the spell checker when you click the button. The next step is to implement the JavaScript code to notify your server side code so that your server side code can log the event. There are many ways to do this. You can make an AJAX call to the same page (see ASP.NET AJAX or our CallbackPanel for more details), or call a separate web service from your code. You can also dynamically create an element that pulls a certain Url from your server, for example:
Code: JavaScript
var img = document.createElement("IMG");
document.body.appendChild(img);
img.src ="ReportSpellCheckerActivitiy.aspx?whatever=…..";
This will instruct the browser to load an image whose url is "ReportSpellCheckerActivitiy.aspx?whatever=....", this in turn calls your server side page ReportSpellCheckerActivitiy.aspx with whatever argument you pass in. You can examine the arguments in that page’s Page_Load and perform whatever logging there. The trick is since you are dynamically creating an image in your page, you should make sure the page does render an image when you are done with logging, otherwise a red cross will show up on your page indicating the image failed to load. The image you render is usually a 1 by 1 transparent gif so that user will not notice anything at all.
Hope this helps.
Thanks!