I'm trying to pass Delatils View Label value to to Details view.
you can see code below
- protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
- {
- if (e.CommandName.Equals("apply"))
- {
- Frm_User.Visible = true;
-
- Label LbdvCode1 = (Label)DetailsView1.Rows[0].FindControl("lb_Jcode");
-
- Label LbfrmCode1 = (Label)Frm_User.FindControl("LB_VacancyCode");
- LbfrmCode1.Text = LbdvCode1.ToString();
- }
- if (e.CommandName.Equals("Cancel"))
- {
- Response.Redirect("~/jobs.aspx");
- }
-
- }
Code Below Form View ItemCommand Event:
- protected void Frm_User_ItemCommand(object sender, FormViewCommandEventArgs e)
- {
-
- try
- {
- if (e.CommandName.Equals("Insert"))
- {
-
- Frm_User.DataBind();
- LBFRm_Suc.Text = "Your Vacancy Order has been submitted.";
- }
- }
- catch (Exception ex)
- {
-
- LBFRm_Fail.Text = ex.Message;
- }
- if (e.CommandName.Equals("Cancel"))
- {
- Frm_User.Controls.Clear();
- Frm_User.Visible = false; }
- }
In Form View Event (LOad) am trying to catch label vlaue in Details View but no way, see code below:
- protected void Frm_User_Load(object sender, EventArgs e)
- {
- Label Lbfrmdate = (Label)Frm_User.Row.FindControl("LB_FRMDate");
- Lbfrmdate.Text = DateTime.Now.ToShortDateString();
-
-
-
-
- }
See a photo to know what I mean: