content not updated in UpdatePanel (in a Web Part)
-
30 มกราคม 2555 18:02
I have to update asp controls (label and table) in my Web Part (SharePoint2010) when the user select an element in a DropDownList control. I added a EventHandler to the DropDownList that edit the label and the cells of the the table.
I am using asp:UpdatePanel with asp:AsyncPostBackTrigger trigger.
When debugging in VS2010, I can see that the server side method is called, the label and the table cells are updated.
But the controls aren't updated in the Web Part when AJAX call is returned. And when I monitor the HTTP response in FireBug console, I can see that the server isn't returning the updated controls values.
Here is the code of ascx :
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"
OnSelectedIndexChanged="listBoxSelectedIndexChanged">
</asp:DropDownList>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="testlabel" runat="server">test</asp:Label>
<asp:Table ID="Table1" runat="server" Height="100px" Width="253px"
CellPadding="1" CellSpacing="1" CssClass="marcheFonds">
</asp:Table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>And in the server side method listBoxSelectedIndexChanged (partial class ListeUserControl : UserControl), I am doing this :
Table1.Rows[i].Cells[j].Text = rate.month1;
Table1.Rows[i].Cells[j].Text = rate.month2;
Table1.Rows[i].Cells[j].Text = rate.month3;
Table1.Rows[i].Cells[j].Text = rate.month6;
Table1.Rows[i].Cells[j].Text = rate.month12;I am not using a gridview because the structure of the table is complex.
Any idea please ?
Ala- ย้ายโดย Brent Serbus 1 กุมภาพันธ์ 2555 1:22 maybe this is right place (From:SharePoint - Development and Programming (pre-SharePoint 2010))
ตอบทั้งหมด
-
1 กุมภาพันธ์ 2555 9:12ผู้ดูแล
-
17 มีนาคม 2555 0:12
Information in this article might help http://msdn.microsoft.com/en-us/library/bb861877.aspx.
-
19 มีนาคม 2555 17:38No I did tried the solutions offered in this article but nothing is working.
For testing purpose, I replaced the dropdownlist by a button and the update panel works perfectly with the AsyncPostBackTrigger trigger (click event).
So the problem is with the dropdownlist and the SelectedIndexChanged event ...
It is so annoying problem ...Ala
-
20 มีนาคม 2555 22:59Can you move the DropDownList inisde the UpdatePanel, see if that helps.
-
21 มีนาคม 2555 9:21I have already tried to move the DropDownList inside the UpdatePanel in vain, it isn't working.
Ala
-
26 มีนาคม 2555 23:38If you are still having issues with this and you cannot find an answer from the forum directly, please visit the link below to see the various paid support options available that may better meet your needs.
http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone