"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Saturday, April 16, 2011

2 redirect on 1event OR Two fires on One event

 Hi *.*,
Yup 2 fires on one event i can say this way too. Here i'm meeting this by JavaScript and by server-side.
Here it's go:

 
On HTML side


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script type="text/javascript">
        function red() {
            window.open('Page1.aspx');
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Button runat="server" id="btn" OnClientClick="red();" Text="redirect"
            onclick="btn_Click" />
    </div>
    </form>
</body>
</html>

On server side:


    protected void btn_Click(object sender, EventArgs e)
    {
        Response.Redirect("page2.aspx");
    }


Hope u got it.If any trouble ask me.
Stay tune...

Have a nice day... 'N happy Coding :)

No comments: