Click here to Skip to main content
15,921,279 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,
I am using VS 2005,C#.net,ASP.NET.
I have a web application.
When clicking of a button,I need to execute one C# function .
Based on its return value, then one confirmation message has to come.
IF the answer is yes, another c# code block should be executed and another confirmation message has to come.
IF the answer is No, another C# code block should be executed
How to implement this

Thanks in advance
Geroge
Posted

See I m just showing one idea how to do it
//Define a c# function with the bool return type
bool ValueExecution()
{
if(radioButtonYes.IsChecked) return true;
else if(radioButtonNo.IsChecked) return false;
return false;
}

//Call the above function in your submit button
protected void Submit_Clicked(object sender, EventArgs e)
{
 if(ValueExecution()){
   Response.Write("You have clicked yes radio button");
  };
else {
  Response.Write("You have clicked no radio button");
   }
}
 
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