各位高手....請看看我以下的代碼....為何不能觸動ontextchanged="Txt_Calendar_TextChanged" <asp:TextBox ID="Txt_Calendar" runat="server" Width="110px" CssClass="input1"
AutoPostBack="True" ontextchanged="Txt_Calendar_TextChanged" ></asp:TextBox>
<img id="Image_blqx1" style="CURSOR: hand; width: 23px; height: 15px;"
onclick="popUpCalendar(this,document.forms[0].Txt_Calendar,'yyyy-mm-dd')"
src="../Calendar/Images/calendar.gif" alt="time" />以下是我後台的代碼 protected void Txt_Calendar_TextChanged(object sender, EventArgs e)
{
PruDs1 = bc.GetDataSet("select * from Ann_POS_PurchaseIDView where PurOrdate='" + this.Txt_Calendar.Text.Trim() + "'", "Ann_POS_PurchaseIDView", 1);
ProDS1 = bc.GetDataSet("select * from Ann_ERP_SaleProductsView where erp_saleProductsDate='" + this.Txt_Calendar.Text.Trim() + "'", "Ann_POS_PurchaseIDView", 1);
if (PruDs1.Tables[0].Rows.Count > 0)
{
this.GV_PurOrdTitle.DataSource = PruDs1;
this.GV_PurOrdTitle.DataBind();
}
else
{
GVNodata(1);
}
if (ProDS1.Tables[0].Rows.Count > 0)
{
this.GV_SaleOrderTitle.DataSource = ProDS1;
this.GV_SaleOrderTitle.DataBind();
}
else
{
GVNodata(2);
}
}
AutoPostBack="True" ontextchanged="Txt_Calendar_TextChanged" ></asp:TextBox>
<img id="Image_blqx1" style="CURSOR: hand; width: 23px; height: 15px;"
onclick="popUpCalendar(this,document.forms[0].Txt_Calendar,'yyyy-mm-dd')"
src="../Calendar/Images/calendar.gif" alt="time" />以下是我後台的代碼 protected void Txt_Calendar_TextChanged(object sender, EventArgs e)
{
PruDs1 = bc.GetDataSet("select * from Ann_POS_PurchaseIDView where PurOrdate='" + this.Txt_Calendar.Text.Trim() + "'", "Ann_POS_PurchaseIDView", 1);
ProDS1 = bc.GetDataSet("select * from Ann_ERP_SaleProductsView where erp_saleProductsDate='" + this.Txt_Calendar.Text.Trim() + "'", "Ann_POS_PurchaseIDView", 1);
if (PruDs1.Tables[0].Rows.Count > 0)
{
this.GV_PurOrdTitle.DataSource = PruDs1;
this.GV_PurOrdTitle.DataBind();
}
else
{
GVNodata(1);
}
if (ProDS1.Tables[0].Rows.Count > 0)
{
this.GV_SaleOrderTitle.DataSource = ProDS1;
this.GV_SaleOrderTitle.DataBind();
}
else
{
GVNodata(2);
}
}
protected void Txt_Calendar_TextChanged(object sender, EventArgs e)
{
Response.Write("显示这里吗");
}
textBox.fireEvent( "onchange ")或者textBox.onchange()或者form1.submit()来刷新
textBox.fireEvent( "onchange ")或者textBox.onchange()或者form1.submit()来刷新
删除或改成false再试试。