protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //Creating Session Object //Session["UserId"] = 1001; //Delete the above portion //Populating JS Details JobSeekerBAL jobSeekerBal = new JobSeekerBAL(); var table = jobSeekerBal.GetJobSeekerDetails(Convert.ToInt32(Session["UserId"])); LabelJobSeekerId.Text = table.Rows[0][0].ToString(); LabelJobSeekerName.Text = table.Rows[0][1].ToString(); LabelCity.Text = table.Rows[0][2].ToString(); LabelDetails.Text = table.Rows[0][3].ToString(); LabelJobCategory.Text = table.Rows[0][4].ToString(); Session["JobCategoryId"] = table.Rows[0][5].ToString(); //populating City DropDown var cityBal = new CityBAL(); var citiesTable = cityBal.GetCities(); foreach (DataRow row in citiesTable.Rows) { var li = new ListItem(row[1].ToString(), row[0].ToString()); DropDownListCity.Items.Add(li); } //Populate Applied Jobs GridView PopulateGridViewAppliedJobs(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CityBAL cityBal = new CityBAL(); JobCategoryBAL jobCategoryBal = new JobCategoryBAL(); var citiesTable = cityBal.GetCities(); var jobCategoryTable = jobCategoryBal.GetJobCategory(); foreach (DataRow row in citiesTable.Rows) { // Creating a list-item with key-value pair of City-CityId ListItem li = new ListItem(row[1].ToString(), row[0].ToString()); DropDownListCity.Items.Add(li); DropDownListCompanyCity.Items.Add(li); } foreach (DataRow row in jobCategoryTable.Rows) { ListItem li = new ListItem(row[1].ToString(), row[0].ToString()); DropDownJobCategory.Items.Add(li); } } }