Click here to Skip to main content
15,895,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<asp:Button ID="btnTsave"  runat="server" Text="Save as Draft" CommandName="Save" OnClick="btnSaveasDraft_Click" />
                <asp:Button ID="btnConfirm" runat="server" Text="Confirm" CommandName="Confirm" OnClick="btnConfirm_Click" />
                <asp:Button ID="btnApprove" runat="server"  Text="Approve" CommandName="Approve" OnClick="btnApprove_Click" />
 <cc1:RadWindowManager  runat="server" ID="RadWindowManager1">
    <Windows>
        <cc1:RadWindow ID="rw_customConfirm" Modal="true" Behaviors="Close, Move" VisibleStatusbar="false"
            Width="300px" Height="200px"  runat="server">
            <ContentTemplate>
                <div class="rwDialogPopup radconfirm">
                    <div class="rwDialogText">
                        <asp:Literal ID="confirmMessage" Text="" runat="server" />
                    </div>
                    <div>
                        <cc1:RadButton  runat="server" ID="rbConfirm_OK" Text="OK"  önClick="rbConfirm_OK_Click">
                        </cc1:RadButton>
                        <cc1:RadButton  runat="server" ID="rbConfirm_Cancel" Text="Cancel"  önClientClicked="closeCustomConfirm">
                        </cc1:RadButton>
                    </div>
                </div>
            </ContentTemplate>
        </cc1:RadWindow>
    </Windows>
</cc1:RadWindowManager>



C#
protected void btnApprove_Click(object sender, EventArgs e)
        {
             
            confirmMessage.Text = "Are you sure you want to Save this file?";
            string script = "function f(){radopen(null, 'rw_customConfirm');                                    Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
           ScriptManager.RegisterStartupScript(Page, Page.GetType(), "customConfirmOpener", script, true);
        }
protected void btnSaveasDraft_Click(object sender, EventArgs e)
        {
 confirmMessage.Text = "Are you sure you want to Save this file in Draft?";
            string script = "function f(){radopen(null, 'rw_customConfirm');                                    Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
           ScriptManager.RegisterStartupScript(Page, Page.GetType(), "customConfirmOpener", script, true);
}


now what will happen after clicking on one button based on button click radconfirm will open now after clicking on "ok" button in RadConfirm it will perform 3operations means if button1 ok click it will some and if it button2 click it will do some other like that
C#
protected void rbConfirm_OK_Click(object sender, EventArgs e)
        {
            
//here i have two perform 3operations if it save button ok clik it will do some
//if it is Approve button ok click it will do some other
            }
        }

how to find button id in RadConfirm ok click
Posted
Updated 30-Jun-14 19:12pm
v2

1 solution

Use the sender object to get a reference to the button that was clicked.

C#
protected void rbConfirm_OK_Click(object sender, EventArgs e)
        {

             Button clickedButton = new Button();
            clickedButton = (Button)sender;

            if (clickedButton.Text == "save") {
                //do something
            }
            else if (clickedButton.Text == "ok")
            {
                //do something else
            }
            else { 
             //or something else
            }
            }
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900