Home : WebForms Web Viewing Controls (Legacy) : Cancel Creation of Annotations in WebAnnotationViewer control (Legacy Web Controls)
Q10387 - HOWTO: Cancel Creation of Annotations in WebAnnotationViewer control (Legacy Web Controls)

Legacy Controls NOTICE

This article references our legacy Web Forms Web Viewing controls (WebImageViewer, WebAnnotationViewer, WebThumbnailViewer). It is preserved for archival purposes, but support strongly recommends using our modern HTML5 web controls: WebDocumentViewer, WebDocumentThumbnailer instead)


Main Article Content

Sometimes, it is necessary to abort/cancel the user/interactive creation of an annotation on our WebAnnotationViewer after it has begun.

For example: a user starts creating a highlight annotation, but drags the mouse off the control and clicks on a different page in the WebThumbnailViewer; technically, annotation creation is still occurring back on the previous page/layer.

Adding a handler for WebThumbnailViewer1.SelectedIndexChanged  that will call WebAnnotationViewer1.CancelCreateAnnotation();   will stop the creation of the initial annotation without leaving a partial annotation on the existed page.

WebThumbnailViewer1.SelectedIndexChanged = CancelCreation;

function CancelCreation() {


This is also useful when you wish to give the user the option to manually cancel interactive creation. You can make a simple button with a call to this will cancel the current creation:

<input type="button" id="btn_CancelAnnotation" value="Cancel" onclick="WebAnnotationViewer1.CancelCreateAnnotation(); return false;" />

(note the use of return false; to keep the button from posting back - this is important to the proper functioning of our WebAnnotationViewer/WebThumbnailViewer controls.


NOTE: This article is specifically about our ASP.NET web control: WebAnnotationViewer. For cancelation of interactive annotation creation in a WinForms solution using our AnnotateViewer control, please see KB 10112

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?


Tell us why you rated the content this way. (optional)
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2020. InstantASP Ltd. All Rights Reserved