TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Darwin Ahmed
NA
6
934
Compiler Error Message: CS1061
Aug 27 2019 6:09 PM
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)
{
//Search for the Customer from database
SqlConnection con =
new
SqlConnection(ConfigurationManager.ConnectionStrings[
"ConnectionString"
].ConnectionString);
con.Open();
SqlCommand com =
new
SqlCommand(
"Select * from CustomerData Where CISno= '"
+ TextBoxCustomerNo.Text +
"'"
, con);
//SqlDataAdapter da = new SqlDataAdapter(com);
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());
//check if date is not null
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
;
}
}
Reply
Answers (
3
)
How to load Load Table
SSRS Report showing continue in the next page