为什么单击按扭,要单击两次GrideView才绑定刷新,在线等,急,谢谢。。。
名称:textbox_name 地区:textbox_area
linkbutton_search
用户控件.ascx.cs文件
public partial class UserControl_productSearch : System.Web.UI.UserControl
{
public string strwhere = "mm_goodsinfo.S_delFlag= '0 ' ";
DataGoodsType type = new DataGoodsType();
DataArea area = new DataArea();
public string strsql
{
get
{
return Label_sql.Text;
}
set
{
Label_sql.Text = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
type.DDLkind1(DDL_kind1);
type.DDLkind2(DDL_kind2);
area.DropDownListBind(DDL_area);
Label_sql.Text = strwhere;
}
}
protected void linkbutton_search_Click(object sender, ImageClickEventArgs e)
{
if (this.textbox_name.Text != " ")
{
Label_sql.Text = strwhere + "and (mm_goodsinfo.s_shortname like '% " + TB_name.Text + "% ' or mm_goodsinfo.S_goodsname like '% " + TB_name.Text + &