Avance Zone

Technical Experts Zone Blogs

Get Asp.net Dynamic ID In Client Side For JavaScript

Get Asp.net ID Dynamic Server Id in Client Side For JavaScript 

<script type=”text/javascript” language=”javascript”>

    function search()

    {

    if (document.getElementById(”<%=txt_search.ClientID %>“).value==”")

    {

        alert(”Please Enter Keyword”);

    }    

    }

</script>

<asp:ImageButton ID=”btn_search” OnClientClick=”return search()” runat=”server” ToolTip=”Search the website”/>

Here i Shown How i Fetched the Dynamic Image Button Id in the server side to implemnt the javascript Function.

Enjoy !!! Please Comment if you need a clear Understanding.

javascript right click – disable right click To avoid view source or steal Images

Here is the simple way to make the visitor not to steal your webpage image or source, You can use this for Any web designs – html/php/asp.net 

Insert this html with your source code

Way 1

<img src=”PicFileName.gif” height=”24″ width=”100″ onContextMenu=”return false;”>
<img src=”PicFileName.gif” height=”24″ width=”100″ onContextMenu=”alert(’Avance Zone Alert!’);return false;”>
<img src=”PicFileName.gif” height=”24″ width=”100″ onContextMenu=”alert(’Visitor! Don\’t Steal my picture!’);return false;”>
Way 2

In body onload call the javascript 
<body onContextMenu =”callme();”>
In head introduce this below lines
<script type=”text/javascript” language=”javascript”>
    function callme()
    {
alert(’Visitor! Don\’t Steal my picture!’);
return false;
}
</script>
|