01/01/2019 |
Admin |
C#
Erreur :
[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
Thread was being aborted.
System.Runtime.Serialization.SafeSerializationManager
Solution :
SI vous utilisez :
Response.Redirect("YourUrl");
Remplacez cette expression par :
Response.Redirect("YourUrl", false);
Explication :
false permet de préciser que l'exécution de la page actuelle doit s'arretter.
Lire >>
01/01/2019 |
Admin |
C#
Erreur de ce type : "Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel" :
"Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_updxxx'. If it is being updated dynamically then it must be inside another UpdatePanel."
Si vous rencontrez cette erreur c'est que vous tentez de masquer (Visible = false) un panel qui contient un update panel. Ou de mettre a jour un update panel qui est dans un panel avec l'attribut visible = false
Déplacer le panel dans l'update panel et ce sera bon !
<asp:UpdatePanel runat="server" ID="updXXX" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel runat="server" ID="pnlXXX" Visible="false">
CONTENT
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
Lire >>