Q:

Is it possible to Call one Event into Another Evevnt in Asp.net

I want to call One Event into Another Event... can we do this task...
protected void DetailsView1_ModeChanging(object sender, DetailsViewModeEventArgs e)
    {
        DetailsView1.ChangeMode(e.NewMode);
        DetailsView1.DataSource = GetDetails.GetEmpDetailsById(Convert.ToInt32(Session["empId"]));
        DetailsView1.DataBind();
    }

protected void btnEdit_Click(object sender, EventArgs e)
{

}

I just want to Call a DetailsView1_ModeChanging Event into a btnEdit_Click just Like below
protected void btnEdit_Click(object sender, EventArgs e)
    {
       DetailsView1_ModeChanging(object sender, DetailsViewModeEventArgs e);
    }

If it is possible Above One how can pass sender and e

A:

You should extract the logic from DetailsView1_ModeChanging into another method, e.g.
private void ChangeDataSourceMode(DetailsViewMode newMode) {
    DetailsView1.ChangeMode(newMode);
    DetailsView1.DataSource = GetDetails.GetEmpDetailsById(Convert.ToInt32(Session["empId"]));
    DetailsView1.DataBind();
}

protected void DetailsView1_ModeChanging(object sender, DetailsViewModeEventArgs e) {
    ChangeDataSourceMode(e.NewMode);
}

protected void btnEdit_Click(object sender, EventArgs e) {
    ChangeDataSourceMode(DetailsViewMode.Edit);
}

It's normally not good form to put logic into your event handlers, especially if you plan to reuse the functionality later on, because it limits you to only using the logic in one place.

