单击按钮的C#代码 [英] c# code for on click of button

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

问题描述

我的管理页面需要c#代码,该页面具有一个超链接,然后下拉至接受,拒绝或取消请求,然后单击提交"按钮.
我需要按钮onclick事件的代码以在数据库上提交请求.

I need c# code for my admin page which is having one hyperlink then dropdown to either accept,reject or cancel the request and then a submit button.
I need code for onclick event of button to submit the request on database

推荐答案

单击Button控件时会引发Button.Click事件.没有命令名称与Button控件关联(例如,与Submit按钮关联)时,通常使用此事件.
在那里看看- MSDN- [Button.Click事件] [ ^ ]
The Button.Click event is raised when the Button control is clicked. This event is commonly used when no command name is associated with the Button control (for instance, with a Submit button).
Have a look there - MSDN-[Button.Click Event][^]


您只需双击按钮,它将自动生成onclick事件,然后您可以编写在单击按钮时需要执行的任何代码.
You need to just double click on the button, it will automatically generate onclick event and then you can write whatever code you need to execute on button click.


单击按钮时将触发OnClick事件.
此处 [
在表单上设置defaultbutton 会将其设置为提交
"按钮 [
The OnClick event is fired when a button is clicked.
Here[^] is a very nice and easy example (click on the submit button).

Setting the defaultbutton on the form will set it to be the Submit button[^].


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

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