This is a migrated thread and some comments may be shown as answers.

how to check if the Radbutton clicked

1 Answer 186 Views
Button
This is a migrated thread and some comments may be shown as answers.
Avihai
Top achievements
Rank 1
Avihai asked on 24 Dec 2013, 02:22 AM

Hello all,










I have a little problem: I have a modal popup that opens whenever the user click radbutton..I'm trying to open the modal popup from the code behind if the user click on the button how can I check if the user click on the button from the code behind?







(I don't want to use JS front code to open the modal popup)











*************code behind***********







 Protected Sub GenerateLinks()















        If Not String.IsNullOrEmpty(btnAddNewPerson.?????) Then







            ' ''Open RadWindow







            Dim script As String = "function f(){$find(""" + modalPopup.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"







            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)







            Exit Sub







        End If







End Sub















***********aspx code***********







 <telerik:RadButton ID="btnAddNewPerson" runat="server" Visible="false"  ClientIDMode="Static" Text="Add Person" AutoPostBack="false" OnClientClicking="OnClientClicking"/>







                                    <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4" />







                                </telerik:RadButton>















******JS function*********















 function OnClientClicking(button, args) {







                window.location = button.get_navigateUrl();







                args.set_cancel(true);







            }
















1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Dec 2013, 04:17 AM
Hi Avihai,

I guess that you want to show a RadWindow modal popup on the Button OnClick event. Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadButton ID="RadButton1" runat="server" Text="Open ModalPopUP" OnClick="RadButton1_Click">
</telerik:RadButton>
<telerik:RadWindow ID="ModalPopUp" runat="server">
</telerik:RadWindow>

C#:
protected void RadButton1_Click(object sender, EventArgs e)
{
    ModalPopUp.VisibleOnPageLoad = true;
}

Let me know if you have any concern.
Thanks,
Princy.
Tags
Button
Asked by
Avihai
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or