TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aktham Mahmoud
NA
720
37.7k
pass Details View label value to Form View
Feb 9 2020 10:19 AM
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();
//==========
//Label LbdvCode1 = (Label)DetailsView1.Rows[0].FindControl("lb_Jcode");
//Label LbfrmCode1 = (Label)Frm_User.FindControl("LB_VacancyCode");
//LbfrmCode1.Text = LbdvCode1.ToString();
}
See a photo to know what I mean:
Reply
Answers (
1
)
List with Parameter’s object name gets Prefixed with @
How to access members of your model to your Controller?