c# - UpdatePanel inside Repeater -


In my UserControl, I am trying to update an updated panel which is in such a repeater: / P>

HTML-mark

  & lt; Asp: UpdatePanel id = "updDocumentQuickView" runat = "server" UpdateMode = "conditional" & gt; & Lt; ContentTemplate & gt; & Lt; Asp: repeater id = "repofolders" runat = "server" on item data = "repoders_ontamadatabase" on item command = "reporter_onlinecomment" & gt; & Lt; ItemTemplate & gt; & Lt; Asp: LinkButton id = "lnkFolder" runat = "server" & gt; & Lt; / Asp: LinkButton & gt; & Lt; Asp: UpdatePanel id = "update files" runat = "server" updatemode = "conditional" & gt; & Lt; ContentTemplate & gt; & Lt; Asp: Repeater id = "repFiles" runat = "server" on item data = "repFiles_OnItemDataBound" & gt; & Lt; ItemTemplate & gt; & Lt;% # Container.Dataite% & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: Repeater & gt; & Lt; / ContentTemplate & gt; & Lt; / ASP: UpdatePanel & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: Repeater & gt; & Lt; / ContentTemplate & gt; & Lt; / ASP: UpdatePanel & gt;   

C # - Code

  Secure void repFolders_OnItemCommand (Object Sender, CommandEventArgs e) {int intRow = -1; Script Manager myScriptManager = (Script Manager) Page.Master.FindControl ("myScriptManager"); Mail myMatch = Regex.Match (myScriptManager.AsyncPostBackSourceElementID, "repFolders.ctl ([0-9] *) .lnkFolder"); If (myMatch! = Null) intRow = Convert.ToInt32 (myMatch.Groups [1]. Value); If (intro> -1) {repeater iitim myItem = repFolders.Items [intro]; Repeater repFiles = (Repeater) myItem.FindControl ("repFiles"); UpdatePanel updFiles = (UpdatePanel) myItem.FindControl ("updFiles"); String [] arr1 = new string [] {"array item 1", "array item 2", "array item 3", "array item 4", "array item 5"}; RepFiles.DataSource = arr1; RepFiles.DataBind (); UpdFiles.Update (); }}   

The last result I get is that the UpdateDocumentQuickView UpdatePlan is updated, and does not update files. If I wrap an UpdatePanel around the lnkfolder, then that UpdatePanel is updated with the same C # code. I checked what kind of data is sent back with intelligence, and the wrong UpdatePanel is sent. I am getting the correct repeater item, and both repFiles and updFiles are found. What do I miss to get the right Update panel to update?

UPDATE

Updated with the Hawdby solution updated, thanks for the update, thanks for that. But there is still no problem in sending back anything in the updated files. With some more testing, fixed files and literally inserting inside the work, tells me that there is something with repFiles that is not returnable in the Repfiles bound data.

The final solution

was set to wrong in repFiles.Visible repFolders_OnItemDataBound, no wonder it did not show up.

This is because you have to explicitly set the asynchronous binding

 < Code> & lt; Asp: UpdatePanel ID = "updDocumentQuickView" ChildrenAsTriggers = "false" & gt; & Lt; Trigger & gt; & Lt; Asp: AsyncPostBackTrigger ControlID = "repFolders" EventName = "repFolders_OnItemCommand" /> & Lt; / Trigger & gt; & Lt; / ASP: UpdatePanel & gt;    

Comments