事件未触发以查看详细信息 [英] Event not firing for detailsview

查看:87
本文介绍了事件未触发以查看详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您在gridview中选择一行时,我将打开一个details视图.默认情况下,它将以编辑模式打开.当我单击更新"按钮时,无论是更新事件还是更新事件都会触发.我在每个点上都设置了断点,它只是越过了它们.我缺少或不了解什么?感谢您的任何建议或帮助.

这是代码.

I have a detailsview that opens when you select a row in the gridview. It opens in edit mode as the default. When I click the "Update" button, niether the updated or updating events fire. I have put breakpoints on each and it just passes over them. What am I missing or not understanding? Thank you for any advice or assistance.

Here is the code.

protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
        {
            ddl = this.DetailsView1.Rows[0].Cells[1].FindControl("ddlfunctions") as DropDownList;
            function = ddl.SelectedItem.ToString();

            ddlseg = this.DetailsView1.Rows[1].Cells[1].FindControl("ddlSegment") as DropDownList;
            segment = ddlseg.SelectedItem.ToString();
        }


<asp:DetailsView ID="DetailsView1" runat="server" onmodechanging="DetailsView1_ModeChanging" OnItemUpdated="DetailsView1_ItemUpdated"

          DefaultMode="Edit" CssClass="panelStyle" OnDataBound="DetailsView1_DataBound" CausesValidation="false" ></DetailsView>


另外,我不确定事件中的代码是否正确,我只是知道它没有到达,而且detailsview仅部分显示相关项.


Also, I am not sure the code in the event is accurate, I just know its not getting reached and the detailsview is only there in portion to show the pertinent items.

推荐答案

1.您是否为要使用的dataview定义了SQLDataSource?
2.如果是,则定义的SQLDatasource是否具有带有更新参数的Update命令?
3. DataView是否绑定到SQLDatasource?
4.您是内置更新"按钮还是自定义"按钮?
5.如果使用自定义按钮,您是否调用了DetailsView1.UpdateItem(false)方法?
1. Have you defined the SQLDataSource for the dataview to use?
2. If Yes, Does the SQLDatasource defined has the Updatecommand with Update Parameters?
3. Does the DataView is bound to the SQLDatasource?
4. Do you the Inbuilt Update button or a Customized button?
5. If customized button have you called the DetailsView1.UpdateItem(false) method?


这篇关于事件未触发以查看详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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