In my local machine, its working perfect but when I upload in my hostname, error occured.
Compiler Error Message: CS1061: 'ASP.cusinfo_aspx' does not contain a definition for 'TextBoxCustomerNo_TextChanged' and no extension method 'TextBoxCustomerNo_TextChanged' accepting a first argument of type 'ASP.cusinfo_aspx' could be found (are you missing a using directive or an assembly reference?)
This is my code in desgn page
Line 58: <asp:TextBox ID="TextBoxCustomerNo" runat="server" OnTextChanged="TextBoxCustomerNo_TextChanged" AutoPostBack="True" CssClass="form-control" width="400px"></asp:TextBox>
this is my code behind:
- protected void TextBoxCustomerNo_TextChanged(object sender, EventArgs e)
- {
-
- SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
- con.Open();
- SqlCommand com = new SqlCommand("Select * from CustomerData Where CISno= '" + TextBoxCustomerNo.Text + "'", con);
-
- SqlDataReader dr = com.ExecuteReader();
- if (dr.Read())
- {
- TxtFName.Text = (dr["Fname"].ToString());
- TxtLName.Text = (dr["Lname"].ToString());
- DropDwnCategory.SelectedItem.Text = (dr["Category"].ToString());
- DropDwnIDtype.SelectedItem.Text = (dr["IDtype"].ToString());
- TxtIDNo.Text = (dr["IDno"].ToString());
-
- var dbirt = DateTime.Parse(dr["Dbirth"].ToString());
- if (dbirt != null)
- {
- TxtDbirth.Text = dbirt.ToString("yyyy-MM-dd");
- }
- TxtPbirth.Text = (dr["Pbirth"].ToString());
- TxtAddress.Text = (dr["Addr"].ToString());
- TxtCity.Text = (dr["City"].ToString());
- DropDwnNationality.SelectedItem.Text = (dr["Nationality"].ToString());
- TxtContact.Text = (dr["Contactno"].ToString());
- DropDwnSrcIncome.SelectedItem.Text = (dr["Sourceoffund"].ToString());
- DropDwnWork.SelectedItem.Text = (dr["Natureofwork"].ToString());
- HyperLink1.NavigateUrl = "~/Tomerphoto.aspx?CISno=" + TextBoxCustomerNo.Text;
- DropDownSex.SelectedItem.Text = dr["Gender"].ToString();
- TxtEmail.Text = dr["Email"].ToString();
- TxtEmployer.Text = (dr["Employer"].ToString());
- TxtPostalCode.Text = dr["Postalcode"].ToString();
- DropDwnCountry.SelectedItem.Text = dr["Country"].ToString();
- var dex = DateTime.Parse(dr["Idexpireon"].ToString());
- ExpiryDate.Text = dex.ToString("dd/MM/yyyy");
- if (ExpiryDate.Text == "01/01/1900")
- {
- CheckIDNoExpire.Checked = true;
- ExpiryDate.Visible = false;
- }
- else
- {
- ExpiryDate.Text = dex.ToString("yyyy-MM-dd");
- }
- txtComment.Text = dr["Comment"].ToString();
- con.Close();
- BtnUpdate.Visible = true;
- BtnSave.Visible = false;
- }
- }