0

我有最新版本的 AjaxControlToolkit,并且在 AjaxControlToolkit ReorderList 中使用了 AjaxControlToolkit Html Editor 控件。我需要能够访问“内容”属性,以便可以将值写入数据库,但 FindControl 找不到它。

例如,我可以在 ItemCommandEvent中找到一个TextBox 控件:

Protected Sub IncludedSectionComponentsReorderList_ItemCommand(ByVal sender As Object, ByVal e As AjaxControlToolkit.ReorderListCommandEventArgs) Handles IncludedSectionComponentsReorderList.ItemCommand

 If e.CommandName = "SaveChanges" Then

        Dim txtSectionComponentLabel As TextBox = CType(e.Item.FindControl("txtSectionComponentLabel"), TextBox)

 End If End Sub

但我在同一事件中找不到AjaxControlToolkit Html 编辑器:

Protected Sub IncludedSectionComponentsReorderList_ItemCommand(ByVal sender As Object, ByVal e As AjaxControlToolkit.ReorderListCommandEventArgs) Handles IncludedSectionComponentsReorderList.ItemCommand

    If e.CommandName = "SaveChanges" Then

         Dim editor As Editor = CType(e.Item.FindControl("3Editor"), Editor)
                strSectionControlValue = editor.Content

    End If

End Sub
4

2 回答 2

0

I haven't used the AjaxControlToolKit ReorderList control before, but you may need to access something like the "_OnItemDataBound" event. Sometimes controls are shoved in there when a row is being databound and you can't access them as you would think.

Good luck and hope this helps some.

于 2009-11-12T20:37:14.253 回答
0

这里有一个解决方案:

在此示例中,它将内容从 aspx 页面转移到 ascx 页面

    AjaxControlToolkit.HTMLEditor.Editor txtNotes = (AjaxControlToolkit.HTMLEditor.Editor)Page.FindControl("txtNotes");
    txtView.Content = txtNotes.Content;
于 2015-06-02T03:05:42.670 回答