Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Private void GetDetails()
{
//written code here
}

private void CourseDetails()
{
//written code here
}



i have one show button as follows;

i have two radio button as follows radiobutton1 and radiobutton2.

if radio button1 checked true means GetDetails function want to execute.
if radio button2 checked true means CourseDetails function want to execute.


for that how can i write the code in the Show Button.

for that how can i do using asp.net in c#.

please help me.

Regards,
Narasiman P.
Posted
Comments
Varun Sareen 17-May-13 2:07am    
Have you tried something till now or have you searched google for the same?

Please try first then if you face some problem then post your problem here.

Regards


Varun Sareen

1 solution

You can use OnCheckedChanged event to do that:

ASP.NET
<asp:radiobutton id="radiobutton1" groupname="Group1" text="Yes" value="Yes" runat="server" oncheckedchanged="Group1_CheckedChanged" xmlns:asp="#unknown" />
<asp:radiobutton id="radiobutton2" groupname="Group1" text="No" value="No" runat="server" oncheckedchanged="Group1_CheckedChanged" xmlns:asp="#unknown" />


C#
protected void Group1_CheckedChanged(Object sender, EventArgs e)
{
    if (radiobutton1.Checked) {
        GetDetails();
    }

    if (radiobutton2.Checked) {
        CourseDetails();
    }
}



For more details Refer :
http://stackoverflow.com/questions/8095256/asp-net-radio-button-change[^]
 
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