Following is the sample, which will help you to create context menu on right click of textbox.
CSS
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
table
{
border: 1px solid #ccc;
}
table th
{
background-color: #F7F7F7;
color: #333;
font-weight: bold;
}
table th, table td
{
padding: 5px;
border-color: #ccc;
}
.context-menu
{
position: absolute;
top: auto;
left: 10px;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0px;
margin: 2px 0px 0px;
font-size: 14px;
background-color: #FFF;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
}
.context-menu > li
{
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857;
color: #333;
cursor: pointer;
}
.context-menu > li:hover
{
background-color: #ccc;
}
</style>
HTML
<asp:TextBox ID="txtLanguage" runat="server" ></asp:TextBox>
<ul class="context-menu" style="display: none">
<li>Hindi</li>
<li>English</li>
<li>Marathi</li>
</ul>
Javascript
<script type="text/javascript">
$('body').on("click", function (e) {
$('.context-menu').hide();
});
$('body').on("mousedown", "#txtLanguage", function (e) {
if (e.which = 1) {
$('.context-menu').hide();
}
if (e.which = 3) {
$('body').on('contextmenu', '#txtLanguage', function (e) {
return false;
});
$('.context-menu').show();
}
});
</script>
Screenshot
Hope its work for you !