En una página contiene dos UpdatePanels
, ¿cómo puedo saber qué UpdatePanel
causa el PostBack
parcial?¿Determinar qué UpdatePanel causa el PostBack parcial (asincrónico)?
Me refiero al controlador de eventos Page_Load
.
Este es mi código:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"
onprerender="UpdatePanel1_PreRender">
<ContentTemplate>
<A:u1 ID="u1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"
onprerender="UpdatePanel2_PreRender">
<ContentTemplate>
<A:u2 ID="u2" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
yo probamos este código, pero no se trabaja alost!
protected void Page_Load(object sender, EventArgs e)
{
if (ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
{
if (UpdatePanel1.IsInPartialRendering)
{
// never enter to here
}
if (UpdatePanel2.IsInPartialRendering)
{
// neither here
}
}
}
¡Cualquier ayuda!
¡Lo probé, no funcionó! – Homam
@John, ¿cuál es el comportamiento que observas? ¿Recibió un mensaje de error? –
No, pero no se ingresa si stetement nunca. – Homam