View Single Post
Old Mar 22nd, 2005, 4:42 PM   #4
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
Finally I found the solution:

To call function:

bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID);

The 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;
}

Greetings.

A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span>
see07 is offline   Reply With Quote