Rss Feed Like Us on facebook Google Plus
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

August 15, 2013

Auto Refresh an Asp.Net Web page


when You want to Refresh a web page automatically..
You can simply add following line of code in the Header section to enable auto refresh in an ASP.NET web page.
<meta http-equiv="refresh" content="15">
Where 15 refers to the number of seconds it will take before refreshing the page.
Also you can redirect to a specific page if you put the URL inside the tag.

<meta http equiv="refreshcontent="15;url=http://www.techimpulsion.in" >
In reality, this is standard HTML functionality and nothing specific to ASP.NET. The same effect of auto-refresh would be seen whether it is an ASP.NET page or just a HTML page, or a page made in Java, PHP, ColdFusion, Perl or the like.
More Preferential for Asp.net Developers

If you want to set the refresh time dynamically then that can be done in ASP.NET by adding server side code in the Page_Load function to set it, as shown below: 
Response.AppendHeader("Refresh", "15")
you can change the refresh time according to your requirement.
Read More

August 9, 2013

Disable Ctrl+C ,Ctrl+V ,Ctrl+A in a web page : Javascript

Question How to disable Ctrl+C , Ctrl+V , Ctrl+A in any web page by using javascript.

More..
Disable Button after clicking on it.

Solution:
just copy and paste below script in <head> section


<script type="text/javascript">
        function Disable_Control_C() {
            var keystroke = String.fromCharCode(event.keyCode).toLowerCase();
 
            if (event.ctrlKey && (keystroke == 'c' || keystroke == 'v' || keystroke == 'a')) {
                alert("This function not allowed");
                event.returnValue = false; // disable Ctrl+C
            }
        }
    </script>

and call the function in html body

<body onkeydown="javascript:Disable_Control_C()">
Hello World!
</body>
</html>
Read More

August 7, 2013

Disable Right Click Button - Javascript

while developing web application ,some situation arises where we have to disable right click button of a mouse in web pages of Asp.Net,PHP ,JSP. you can achieve this by using Javascript.

Qusetion - How to disable right click button of mouse in webpage.

Solution- 
add below script in head section of web page

<script type="text/javascript">
        var msg = "This function is disabled!";
        var bV = parseInt(navigator.appVersion)
        var bNS = navigator.appName == "Netscape"
        var bIE = navigator.appName == "Microsoft Internet Explorer"
 
        function nrc(e) {
            if (bNS && e.which > 1) {
                alert(msg)
                return false
            } else if (bIE && (event.button > 1)) {
                alert(msg)
                return false;
            }
        }
 
        document.onmousedown = nrc;
        if (document.layers) window.captureEvents(Event.MOUSEDOWN);
        if (bNS && bV < 5) window.onmousedown = nrc;
    </script>
..........................................................................................

Read Also...

How to prevent page going back on backspace button click

Read More

© 2011-2016 Techimpulsion All Rights Reserved.


The content is copyrighted to Tech Impulsion and may not be reproduced on other websites.