Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 文本框文本更改事件_Asp.net_C# 4.0 - Fatal编程技术网

Asp.net 文本框文本更改事件

Asp.net 文本框文本更改事件,asp.net,c#-4.0,Asp.net,C# 4.0,我有一个表单,我想在该文本框的文本更改事件上调用一个存储过程, 你有什么建议吗。 提前感谢。您只需处理以下问题: 请注意,如果(!IsPostBack),则应仅将控件数据绑定到,否则不会触发事件。因此,例如在页面加载: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataBindForm(); // which sets the `Text` property

我有一个表单,我想在该文本框的文本更改事件上调用一个存储过程, 你有什么建议吗。
提前感谢。

您只需处理以下问题:

请注意,如果(!IsPostBack),则应仅将控件数据绑定到
,否则不会触发事件。因此,例如在
页面加载

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        DataBindForm();  // which sets the `Text` property of this TextBox among others
    }
}

您使用什么技术来编写表单?是网络表单吗?MVC?您可以编写服务(WCF或遗留服务)方法并通过JavaScript(jQuery)AJAX请求它。
protected void TextBox1_TextChanged(Object sender, EventArgs e)
{ 
    TextBox txt = (TextBox) sender;
    // call your stored-procedure
}
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        DataBindForm();  // which sets the `Text` property of this TextBox among others
    }
}