|
|
|
เลือกDropDownList6แล้ว textboxไม่แสดงข้อมูล รบกวนดูให้ด้วยครับติดตรงไหน |
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2019-02-15 11:11:10 |
By :
sakkapong |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ispostback = true
เหมือน selectedchange ต้อง postback ด้วยหรือป่าวอ่ะครับ
|
|
|
|
|
Date :
2019-02-15 11:46:16 |
By :
adminliver |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่เข้าใจอธิบายยาวๆหน่อยครับ
|
|
|
|
|
Date :
2019-02-15 11:57:40 |
By :
sakkapong |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ส่วนตัวผมเขียน VB ครับ
แต่ผมไม่แน่ใจว่าถ้าลอง debug code ที่คุณ K-YON เขียน Event นี้ทำงานหรือป่าวอะครับ ถ้าทำงานก็ไม่ต้อง postback ก็ได้ครับ
ให้ไปไล่ debug code
ที่จะให้แสดงบน textbox แทนครับ
*****พอดีสังเกตุเห็นดัก if !page.ispostback ไว้เลยไม่แน่ใจว่า Event นี้ทำงานหรือป่าวอะครับ
|
|
|
|
|
Date :
2019-02-15 13:06:21 |
By :
adminliver |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วครับ ผมแก้ตามนี้
Code (C#)
protected void DropDownList6_SelectedIndexChanged1(object sender, EventArgs e)
{
if (con.State == ConnectionState.Closed)
con.Open();
cmd.CommandText = "select * from EmployeeData where Name='" + DropDownList6.SelectedItem.Text + "'";
cmd.Connection = con;
SqlDataReader rd = cmd.ExecuteReader();
if(rd.Read())
{
TextBox15.Text = rd.GetValue(0).ToString();
TextBox19.Text = rd.GetValue(2).ToString();
TextBox21.Text = rd.GetValue(3).ToString();
}
rd.Close();
con.Close();
}
}
|
|
|
|
|
Date :
2019-02-15 13:14:16 |
By :
sakkapong |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|