protected void Page_Load(object sender, EventArgs e) { Util.Validations.RegisterZipScriptBlock(Page.ClientScript, this.GetType(), CountryDropDownList.ClientID); if (!Page.IsPostBack) { // Get the common web service instance. ServiceAccess serviceLoader = ServiceAccess.GetInstance(); CommonService.CommonService commonService = serviceLoader.GetCommon(); // Get the list of contries and populate. IList <CommonService.CountryInfo> countries = commonService.GetCountries(); CountryDropDownList.DataSource = countries; CountryDropDownList.DataValueField = "CountryId"; CountryDropDownList.DataTextField = "Name"; CountryDropDownList.DataBind(); CountryDropDownList.Items.FindByText("United States").Selected = true; CountryDropDownList_SelectedIndexChanged(CountryDropDownList, new EventArgs()); if (Session["loginInfo"] != null && Session["loginInfo"] != "") { InitializeValuesFromSession(); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { HRSCustomersBLL customerBLLObject = new HRSCustomersBLL(); var countries = customerBLLObject.GetCountry(); CountryDropDownList.DataSource = countries; CountryDropDownList.DataTextField = "Value"; CountryDropDownList.DataValueField = "Key"; CountryDropDownList.DataBind(); } else { PasswordTextBox.Attributes.Add("value", PasswordTextBox.Text); ConfirmPassword.Attributes.Add("value", ConfirmPassword.Text); } DateOfBirthTextbox.Attributes["max"] = DateTime.Now.ToString("yyyy-MM-dd"); } catch (Exception ex) { Utility.ExceptionUtility.ExceptionLog(ex); throw; } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["userId"] == null) { hidden.Visible = false; } if (!IsPostBack) { HRSCustomersBLL customerBLLObject = new HRSCustomersBLL(); var countries = customerBLLObject.GetCountry(); CountryDropDownList.DataSource = countries; CountryDropDownList.DataTextField = "Value"; CountryDropDownList.DataValueField = "Key"; CountryDropDownList.DataBind(); } CheckInTextBox.Attributes["min"] = DateTime.Now.ToString("yyyy-MM-dd"); CheckOutTextBox.Attributes["min"] = DateTime.Now.ToString("yyyy-MM-dd"); HiddenLabel.Visible = false; HiddenTable.Visible = false; } catch (Exception ex) { Utility.ExceptionUtility.ExceptionLog(ex); throw; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { if (!Session["userId"].ToString().EndsWith(HRSConstants.ADMINENDSTRING)) { FormsAuthentication.SignOut(); Session.Clear(); } HRSCustomersBLL customerBLLObject = new HRSCustomersBLL(); var countries = customerBLLObject.GetCountry(); CountryDropDownList.DataSource = countries; CountryDropDownList.DataTextField = "Value"; CountryDropDownList.DataValueField = "Key"; CountryDropDownList.DataBind(); } catch (Exception ex) { ExceptionUtility.ExceptionLog(ex); throw; } } }
protected void Page_Load(object sender, EventArgs e) { Util.Validations.RegisterZipScriptBlock(Page.ClientScript, this.GetType(), CountryDropDownList.ClientID); //testpath.Text = Request.PhysicalPath.Replace("AgentRegistration.aspx","Members"); if (!Page.IsPostBack) { try { // Get the common web service instance. ServiceAccess serviceLoader = ServiceAccess.GetInstance(); CommonService.CommonService commonService = serviceLoader.GetCommon(); // Get the list of contries and populate. IList <CommonService.CountryInfo> countries = commonService.GetCountries(); CountryDropDownList.DataSource = countries; CountryDropDownList.DataValueField = "CountryId"; CountryDropDownList.DataTextField = "Name"; CountryDropDownList.DataBind(); CountryDropDownList.Items.FindByText("United States").Selected = true; CountryDropDownList_SelectedIndexChanged(CountryDropDownList, new EventArgs()); // Get the list of secret questions and populate. IList <CommonService.LookupInfo> secretQuestions = commonService.GetLookups("Secret Question"); SecretQuestionDropDownList.DataSource = secretQuestions; SecretQuestionDropDownList.DataValueField = "LookupId"; SecretQuestionDropDownList.DataTextField = "Name"; SecretQuestionDropDownList.DataBind(); // SecretQuestionDropDownList.Items.Add(new ListItem(" ","100")); SecretQuestionDropDownList.Attributes.Add("onChange", "javascript: newQuestion(this);"); } catch (Exception ex) { log.Error("UNKNOWN ERROR:", ex); ErrorLiteral.Text = "An unknown error occurred. Please try again. If the problem persists, please contact your system administrator."; } if (Session["registrationInfo"] != null) { InitializeValuesFromSession(); } } else { if ((SecQuestionHiddenField.Value != "") && (SecretQuestionDropDownList.SelectedValue == "13")) { SecretQuestionDropDownList.SelectedItem.Text = SecQuestionHiddenField.Value; } } }
private void LoadCountry() { CountryManager countryManager = new CountryManager(); CountryDropDownList.DataSource = null; List <Country> country = CountryManager.GetAll(); CountryDropDownList.DataSource = country; CountryDropDownList.DataTextField = "CountryName"; CountryDropDownList.DataValueField = "id"; CountryDropDownList.DataBind(); }
protected void LoadCountryDropDownList() { DataSet data = new DataSet(); CountryDropDownList.DataTextField = "CountryName"; CountryDropDownList.DataValueField = "CountryID"; data.ReadXml(Server.MapPath("~/Resources/XML/Countries.xml"), XmlReadMode.Auto); CountryDropDownList.DataSource = data; CountryDropDownList.DataBind(); ListItem firstItem = new ListItem("Not Selected", "-1"); CountryDropDownList.Items.Insert(0, firstItem); }
public void BindCountryAndRegion() { var countryService = new CountryService(); DataTable resultCountry = countryService.GetCountries(); CountryDropDownList.DataSource = resultCountry; CountryDropDownList.DataTextField = "CountryName"; CountryDropDownList.DataValueField = "Id"; CountryDropDownList.DataBind(); var countryId = Convert.ToInt32(CountryDropDownList.SelectedValue); RegionDropDownList.DataSource = countryService.GetSelectRegion(countryId).DataSet; RegionDropDownList.DataTextField = "RegionName"; RegionDropDownList.DataValueField = "Id"; RegionDropDownList.DataBind(); }
private void LoadCountryComboBox() { List <Country> country = countryManager.GetAllCountrys(); //if (country == null) //{ // country = new List<Country>(); //} Country dcountry = new Country(); dcountry.Id = -1; dcountry.CountryName = "Select.."; country.Insert(0, dcountry); CountryDropDownList.DataSource = country; CountryDropDownList.DataTextField = "CountryName"; CountryDropDownList.DataValueField = "CountryName"; CountryDropDownList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Util.Validations.RegisterZipScriptBlock(Page.ClientScript, this.GetType(), CountryDropDownList.ClientID); if (!Page.IsPostBack) { // Get the common web service instance. ServiceAccess serviceLoader = ServiceAccess.GetInstance(); CommonService.CommonService commonService = serviceLoader.GetCommon(); // Get the list of contries and populate. IList <CommonService.CountryInfo> countries = commonService.GetCountries(); CountryDropDownList.DataSource = countries; CountryDropDownList.DataValueField = "CountryId"; CountryDropDownList.DataTextField = "Name"; CountryDropDownList.DataBind(); CountryDropDownList.Items.FindByText("United States").Selected = true; CountryDropDownList_SelectedIndexChanged(CountryDropDownList, new EventArgs()); RoleDropDownList.Items.Add(new ListItem(RegistrationService.UserRole.Agent.ToString(), Convert.ToInt32(RegistrationService.UserRole.Agent).ToString())); RoleDropDownList.Items.Add(new ListItem(RegistrationService.UserRole.Printer.ToString(), Convert.ToInt32(RegistrationService.UserRole.Printer).ToString())); RoleDropDownList.Items.Add(new ListItem(RegistrationService.UserRole.CSR.ToString(), Convert.ToInt32(RegistrationService.UserRole.CSR).ToString())); RoleDropDownList.Items.Add(new ListItem(RegistrationService.UserRole.Admin.ToString(), Convert.ToInt32(RegistrationService.UserRole.Admin).ToString())); RoleDropDownList.DataBind(); if (Request.QueryString["UserId"] != "") { InitializeValuesFromSession(); } else { Response.Redirect("SearchUsers.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { try { DateOfBirthTextbox.Attributes["max"] = DateTime.Now.ToString("yyyy-MM-dd"); if (Session["userId"] != null) { if (Session["userId"].ToString().EndsWith(Utility.HRSConstants.ADMINENDSTRING)) { Response.Redirect("../Admin/AddHotel.aspx"); } else { Response.Redirect("SearchHotel.aspx"); } } if (!IsPostBack) { HRSCustomersBLL customerBLLObject = new HRSCustomersBLL(); var countries = customerBLLObject.GetCountry(); CountryDropDownList.DataSource = countries; CountryDropDownList.DataTextField = "Value"; CountryDropDownList.DataValueField = "Key"; CountryDropDownList.DataBind(); } else { PasswordTextBox.Attributes.Add("value", PasswordTextBox.Text); ConfirmPassword.Attributes.Add("value", ConfirmPassword.Text); } } catch (Exception ex) { Utility.ExceptionUtility.ExceptionLog(ex); throw; } }