protected void Page_Load(object sender, EventArgs e) { #region Search Customer Handler Button btnSearch = ucSearchCustomer.FindControl("btnSearch") as Button; btnSearch.Click += new EventHandler(btnSearch_Click); Button btnAdd = ucSearchCustomer.FindControl("btnAdd") as Button; btnAdd.Click += new EventHandler(btnAdd_Click); #endregion #region Address Info Button btnCancel = ucAddressInfo.FindControl("btnCancel") as Button; btnCancel.Click += new EventHandler(btnCancel_Click); Button btnSave = ucAddressInfo.FindControl("btnSave") as Button; btnSave.Click += new EventHandler(btnSave_Click); Button ibtnSalesSave = ucSales.FindControl("ibtnSave") as Button; ibtnSalesSave.Click += new EventHandler(ibtnSave_Click); Button ibtnCreditSave = ucCredit.FindControl("ibtnSave") as Button; ibtnCreditSave.Click += new EventHandler(ibtnSave_Click); Button ibtnShipSave = ucShipping.FindControl("ibtnSave") as Button; ibtnShipSave.Click += new EventHandler(ibtnSave_Click); #endregion if (!IsPostBack) { if (Request.QueryString["Mode"] == null) { string securityCode = customerDetails.GetSecurityCode(Session["UserName"].ToString()); Session["SecurityCode"] = securityCode; Session["CustomerLock"] = ""; } else { Session["SecurityCode"] = ""; Session["CustomerLock"] = "L"; ucSearchCustomer.CustomerNumber = Request.QueryString["CustomerNumber"].ToString(); ucSearchCustomer.btnSearch_Click(btnSearch, new EventArgs()); btnSearch_Click(btnSearch, new EventArgs()); } TextBox _txt = ucSearchCustomer.FindControl("txtCustomer") as TextBox; MyScript.SetFocus(_txt); } //Session["UserID"] = Session["UserName"].ToString(); // Register AJAX Ajax.Utility.RegisterTypeForAjax(typeof(CustomerMaster)); if (!IsPostBack) { // AddMode(); } }