单击按钮时的C#功能和确认消息 [英] C# function and confirmation messages when clicking on button

查看:148
本文介绍了单击按钮时的C#功能和确认消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我使用的是VS 2005,C#.net,ASP.NET。

我有一个网络应用程序。

当点击一个按钮时,我需要执行一个C#功能。

根据它的返回值,必须有一条确认消息。

如果答案是肯定的,另一个c#代码块应该被执行,另一个确认消息必须来。

如果答案是否,则应该执行另一个C#代码块

如何实现这个



提前致谢

Geroge

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

推荐答案

查看文章< a href =http://aspsnippets.com/Articles/Server-Side-Code-Behind-Yes-No-Confirmation-Message-Box-in-ASPNet.aspx>服务器端(代码背后)是否确认消息框在ASP.NET 中[ ^ ]。


看我只是s一个想法怎么做

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");
   }
}


这篇关于单击按钮时的C#功能和确认消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆