没有按钮单击存储数据库中的文本框数据 [英] without button click store textbox data in database

查看:95
本文介绍了没有按钮单击存储数据库中的文本框数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 scanner   条形码中的关键字>读取数据
我只做 i 读取数据 by 扫描程序在
文本框中输入 长度 字符 16 & 15 数据在文本框中输入自动将存储在 数据库中。
是否可以通过
textbox_changed事件完成
给我其他选项

解决方案

是.. ..使用 AutoPostBack =True属性在 TextBox 标签中,然后代码更改事件....


  protected   void  txtBox1_TextChanged(< span class =code-keyword> object  sender,EventArgs e)
{
if (txtBox1.Text.Length = = 15 || txtBox1.text.Length == 16
{
// 在此处执行算法
}
}


I use scanner for read data in barcode.
I only do when i read data by scanner it enter in textbox but when length of character 16 & 15 in data which enter in textbox are automatically store in database.
Is possible it done by textbox_changed event?
Give me other option.

解决方案

yes.... use AutoPostBack="True" attribute in TextBox tag and then code on change event....


protected void txtBox1_TextChanged(object sender, EventArgs e)
   {
    if (txtBox1.Text.Length==15 || txtBox1.text.Length==16)
     {
       //do your algorithm here
     }
   }


这篇关于没有按钮单击存储数据库中的文本框数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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