
22/03/2005, 16:35
|
 | | | Fecha de Ingreso: abril-2004 Ubicación: México, D.F.
Mensajes: 112
Antigüedad: 20 años, 10 meses Puntos: 0 | |
Finalmente encontré la solución:
Para llamar la function:
bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID);
La function:
public static bool Hay_PostBack(System.Web.UI.Page parent1, string w1,
string w1cx,
string w1ID,
string w2,
string w2cx,
string w2ID)
{
WUC_CreDes.WebForm1 frm1;
WUC_CreDes.WebForm2 frm2;
string cual = "";
cual = HttpContext.Current.Session["par1"].ToString();
string fofoi = parent1.GetType().ToString();
if(fofoi == "ASP.WebForm1_aspx")
{
frm1 = (WUC_CreDes.WebForm1) parent1;
frm1.Example.Controls.Clear();
if(cual == w1)
{
Control control = frm1.Page.LoadControl(w1cx);
control.ID = w1ID;
frm1.Example.Controls.Add(control);
}
else
{
Control control = frm1.Page.LoadControl(w2cx);
control.ID = w2ID;
frm1.Example.Controls.Add(control);
}
}
else
{
if(fofoi == "ASP.WebForm2_aspx")
{
frm2 = (WUC_CreDes.WebForm2) parent1;
frm2.Example.Controls.Clear();
if(cual == w1)
{
Control control = frm2.Page.LoadControl(w1cx);
control.ID = w1ID;
frm2.Example.Controls.Add(control);
}
else
{
Control control = frm2.Page.LoadControl(w2cx);
control.ID = w2ID;
frm2.Example.Controls.Add(control);
}
}
}
return false;
}
Saludos.
A.L.
__________________ El hombre que tiene amigos ha de mostrarse amigo.... |