Wednesday, February 5, 2014

rad window open and close using rad button

code sample

protected void RadButton1_Click(object sender, EventArgs e)
{
    //pass the ClientID of the RadWindow to open
    string script = "function f(){Open('"+RadWindow1.ClientID+"'); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
}
protected void RadButton2_Click(object sender, EventArgs e)
{
    //pass the ClientID of the RadWindow to close
    string script = "function f(){Close('" + RadWindow1.ClientID + "'); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
}



<script type="text/javascript">
    function Open(win) {
        var window = document.getElementById(win);
        window.control.Show();
    }
    function Close(win) {
        var window = document.getElementById(win);
        window.control.Close();
    }
</script>

No comments:

Post a Comment