예제 #1
0
        protected void ResourceView_DataBound(object sender, EventArgs e)
        {
            Image image  = (System.Web.UI.WebControls.Image)ResourceView.FindControl("imgGenderIcon");
            Label gender = (System.Web.UI.WebControls.Label)ResourceView.FindControl("lblgender");

            //if (image == null) return;
            image.ImageUrl = "employeImages/" + resourceId + ".jpg";

            if (gender.Text == "F")
            {
                image.Attributes.Add("onerror", "this.src='../employeImages/female.jpg';");
            }
            else
            {
                image.Attributes.Add("onerror", "this.src='../employeImages/male.jpg';");
            }

            //Label lblCV_link = (System.Web.UI.WebControls.Label)ResourceView.FindControl("lblCV_link");
            HyperLink HL_Cv_link = (System.Web.UI.WebControls.HyperLink)ResourceView.FindControl("HL_Cv_link");

            if (String.IsNullOrEmpty(HL_Cv_link.NavigateUrl))
            {
                HL_Cv_link.Text = "N/A";
            }

            //Label lblProfile = (System.Web.UI.WebControls.Label)ResourceView.FindControl("lblProfile");
            HyperLink HL_Profile = (System.Web.UI.WebControls.HyperLink)ResourceView.FindControl("HL_Profile");

            if (String.IsNullOrEmpty(HL_Profile.NavigateUrl))
            {
                HL_Profile.Text = "N/A";
            }
        }