简体   繁体   English

btnclick函数调用另一个函数,但是该调用不在btnclick函数中

[英]A btnclick Function calls another function,but the call not in the btnclick function

consider the following: code for buttonclick fn in .cs file : 考虑以下内容:.cs文件中buttonclick fn的代码:

protected void additembtnClick(object sender, EventArgs e)
        {   
          DataTable dt = createTemptable();
            dt = (DataTable)Session["dfdtemptable"];
            this.DFDLOVlst.DataSource = dt;
            this.DFDLOVlst.DataBind();
            this.txtLOVCode.Visible = true;
            this.txtLOVvalue.Visible = true;
            MDIngrdientsCode.Show();
}

this is the on_row clicked fn of the datagrid 这是datagrid的on_row单击的fn

protected void OnFindSelect(int Value)
        { 
                }

code for findbtn click: findbtn的代码,请点击:

protected void btnFind_Click(object sender, EventArgs e)
        {
            this.FindLookup.SetLookup();
            this.FindLookup.SearchLookup();
            this.MdFindLookup.Show();
      }

When the find button is clicked,the lookup control gets loaded with values from database.On selecting any row the selected row values will be added to corresponding text boxs and data grid. 单击查找按钮时,查找控件将从数据库中加载值。选择任何行时,选定的行值将添加到相应的文本框和数据网格中。 The additembtnclick is to add new entry to the datagrid.The user can add new values or can click the find and select a row and update its values in the datagrid. additembnclick用于向数据网格添加新条目。用户可以添加新值,也可以单击查找并选择一行并在数据网格中更新其值。 Theres no problem when the user adds fresh values .When the user click the find and select a particular row.The values gets add to correspondind fieldls..And now if the user clicks the additem button to add new values to already existing values in datagrid then the fn onfindselected(fn for the onrowclicked event for the lookup control containg datagrid) is called automatically,but the call is not in the button click fn.. 用户添加新值时没有问题。当用户单击查找并选择特定行时,这些值将添加到对应的字段中。现在,如果用户单击additem按钮将新值添加到datagrid中已存在的值中然后会自动调用fn onfindselected(对于包含数据网格的查找控件的onrowclicked事件为fn),但该调用不在按钮fn中。

Can't figure out whats wrong..? 无法找出出什么问题..?

It appears that theOnFindSelect is not an event handler itself. 看来OnFindSelect本身不是事件处理程序。 It is probably being called from another event handler (or more than 1). 它可能是从另一个事件处理程序(或多个)中调用的。 Try looking for all calls to it and see if that makes sense 尝试查找所有对其的调用,看看是否有意义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM