Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Monday, March 10, 2014

Prevent Browser Back Option

Use this following code to prevent the web browsers Back button options.

<script type="text/javascript">
        function preventBack() { window.history.forward(); }
        setTimeout("preventBack()", 0);
        window.onunload = function () { null };
</script> 

This will forward to the last history page.

Monday, April 13, 2009

JavaScript alert from UpdatePanel in ASPX (C#)

public void ClientMsg(string MsgTxt)
    {
        ScriptManager.RegisterClientScriptBlock(
        this.Page, 
        this.Page.GetType(), 
        "clientScript", 
        "alert('" + MsgTxt + "')", 
        true);
    }