当使用c#在asp.net中选中复选框时,如何将值从一个文本框发送到另一个文本框 [英] how to send the values from one textbox to another when the checkbox is selected in asp.net using c#

查看:490
本文介绍了当使用c#在asp.net中选中复选框时,如何将值从一个文本框发送到另一个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用提交按钮的情况下使用c#在asp.net中选中复选框,如何将值从一个文本框发送到另一个文本框.


单击提交按钮时,我正在获取代码.

因此,请找出查询并将有用的代码发送给我.



感谢!

Sriaknth.J

how to send the values from one textbox to another when the checkbox is selected in asp.net using c# without submit button.


I am getting the code when the submit button is clicked.

So please find out the query and send me the useful code to me.



Thanks Regards

Sriaknth.J

推荐答案

将复选框AutoPostBack属性设置为True,然后在其状态更改时将发送回发
Set checkbox AutoPostBack property to True, it will then send a postback when its state is changed


如果您已经在提交"按钮中完成了此操作,则只需将代码粘贴到

if(CheckBox1.Checked = true)
{
//您的代码
}
If u already done this in submit button then just paste the code in

if(CheckBox1.Checked=true)
{
//Your code
}


使用复选框选中已更改的事件....

这次活动,
use checkbox checked changed event....

From this event,
if(checkbox1.checked)
{
textbox2.text=textbox1.text
}


这篇关于当使用c#在asp.net中选中复选框时,如何将值从一个文本框发送到另一个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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