see07
Regular
Hello:
From a web form Im sending to execute a function contained into a class, code in web form is:
bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID);
In class code is:
public static bool Hay_PostBack(WUC_CreDes.WebForm1 parent1, string w1,
string w1cx,
string w1ID,
string w2,
string w2cx,
string w2ID)
{
string cual = "";
cual = HttpContext.Current.Session["par1"].ToString();
parent1.Example.Controls.Clear();
if(cual == w1)
{
Control control = parent1.Page.LoadControl(w1cx);
control.ID = w1ID;
parent1.Example.Controls.Add(control);
}
else
{
Control control = parent1.Page.LoadControl(w2cx);
control.ID = w2ID;
parent1.Example.Controls.Add(control);
}
return false;
}
As you can see, Im sending to function container into class my WebForm1 to create in function WUC dynamically created.
Thinking in a second web form, let us say, WebForm2, if within it I send to execute my function:
bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID);
How can I do to function Hay_PostBack, above mentioned work also for WebForm2 What I need to change because first parameter is WUC_CreDes.Web Form1 parent1?
Ill thank your answers.
Greetings.
A.L.
From a web form Im sending to execute a function contained into a class, code in web form is:
bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID);
In class code is:
public static bool Hay_PostBack(WUC_CreDes.WebForm1 parent1, string w1,
string w1cx,
string w1ID,
string w2,
string w2cx,
string w2ID)
{
string cual = "";
cual = HttpContext.Current.Session["par1"].ToString();
parent1.Example.Controls.Clear();
if(cual == w1)
{
Control control = parent1.Page.LoadControl(w1cx);
control.ID = w1ID;
parent1.Example.Controls.Add(control);
}
else
{
Control control = parent1.Page.LoadControl(w2cx);
control.ID = w2ID;
parent1.Example.Controls.Add(control);
}
return false;
}
As you can see, Im sending to function container into class my WebForm1 to create in function WUC dynamically created.
Thinking in a second web form, let us say, WebForm2, if within it I send to execute my function:
bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID);
How can I do to function Hay_PostBack, above mentioned work also for WebForm2 What I need to change because first parameter is WUC_CreDes.Web Form1 parent1?
Ill thank your answers.
Greetings.
A.L.