0

I've two updatepanel in the same page. In one, there is a datalist while in other there is a modal popup. In modal popup I have a Save button that update datalist's data. In effect Save button work correctly and data are updated but to see updated data in datalist I must do a postback while I would that Save button occur an asyncpostback and datalist show me updated data after Save Button' Click.

I do this in updatepanel of modalpopup:

<Triggers>
      <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
</Triggers>

P.S Sorry for my English!

Ivan90
  • 151
  • 4
  • 14

2 Answers2

0

Do the same thing for the UpdatePanel you want to update (that contains the DataList):

<Triggers>
  <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
</Triggers>

Since a child of the UpdatePanel isn't triggering the postback, it doesn't know to refresh, telling it explicitly that when btnSave is clicked it should do so should solve your issue.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155
  • Thanks,Now work but I have another thing to ask you. In my modal popup I have some textbox that allow user to update data but when I insert a value in a textbox and then click Save button in datalist I see my data repeat over and over again with more comma. For example.. if I insert Pippo.. then in datalist I see ,,Pippo,Pippo Why? – Ivan90 Feb 27 '10 at 16:07
  • @Ivan90 - What are you using for the modal? I remember seeing this issue with a particular type of modal a while back, probably the same thing. – Nick Craver Feb 27 '10 at 17:02
  • Mhh... I'm using ModalPopupExtender. I can't resolve this problem. Probably the problem are the properties updatemode and childrenastriggers of two update panel! – Ivan90 Feb 27 '10 at 17:15
  • @Ivan90 - It seems this is an issue with the toolkit, some users on here rolled back to the May release to resolve the issue: http://stackoverflow.com/questions/1588026/modalpopupextender-and-commas-appearing-in-my-textbox-asp-net/1753497#1753497 – Nick Craver Feb 27 '10 at 19:18
0

In you btnSave event handler you can force the datalist panel to update like this:

public void btnSave_Click(object sender, EventArgs e)
{
    // Save logic
    pnlDataList.Update();
}
bendewey
  • 39,709
  • 13
  • 100
  • 125