Reputation: 1809
WODetails.ascx
) that gets WOCode
and fill some fields related to work order.ASPX
page that contains a grid and above user control once i click on grid control (ROWCommand
Event fires)I want to call pageload event once rowcommand event fires, beacuse rowcommand retruns WOCOde
and my usercontrol should fill fields accordingly. But problem is usercontrol pageload events fires after ASPX
pageload event fires
Upvotes: 1
Views: 1791
Reputation: 4903
The Page_Load
is an event called by the .NET framework, it is intended to notify the Controls
of the stage of the page life cycle. It is not meant for this kind of communication.
If you want to communicate with the UserControl
, why not writing a custom method on the UserControl
?
public class WODetails : UserControl
{
...
public void DoMyStuff(object WOCOde)
{
...
}
...
}
And on the ASPX, you just call it when you need:
void grdDummy_RowCommand(object sender, GridViewCommandEventArgs e)
{
object WOCOde = GetWOCode(e);
WODetails.DoMyStuff(WOCOde);
}
Upvotes: 2