how to show popup on right click

Posted by Abhi_patil under JavaScript on 2/19/2009 | Views : 4279 | Status : [Member] | Replies : 1
i am doing spell ckeck.
i want to show popup when right click on any word.




Responses

Posted by: Majith on: 2/19/2009 [Member] Starter

Up
0
Down
Hi Abhi ,

Cal the JavaScript Method in 'OnContextMenu' for Right Click option.

<script type="text/javascript">

function HideModalPopup()
{
var test= $find('ModalPopupExtender1');
test.hide();
}
function showModalPopup()
{
window.parent.document.getElementById('ModalPopupExtender1').show();
}

</script>

<asp:ImageButton ID="ShowBtn" runat="server" />
<Ajax:ModalPopupExtender
ID="ModalPopupExtender1" runat="server" CancelControlID="imbOK"
OkControlID="imbOK" OnCancelScript="HideModalPopup()" PopupControlID="pnlPopup"
TargetControlID="pnlPopup">
</Ajax:ModalPopupExtender>

In PageLoad Event call the Javascript 'showModalPopup()' Method.


ShowBtn.attributes.Add("OnContextMenu","showModalPopup()");

Thats all.




Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response