如何在第二个更新面板中更新datalist [英] How to Update datalist in second update panel

查看:84
本文介绍了如何在第二个更新面板中更新datalist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个更新面板。在一个更新面板中我有一个链接按钮&在其他更新面板中我有datalist。当我点击更新面板的链接按钮一个如何在按钮点击事件上绑定datalist。

解决方案

为第二个更新面板调用__dopostback(''updatepanel2'','''')。



这将导致部分回发到第二个updatepanel,并且在页面的加载事件中你可以绑定控件。



希望这个wud帮助:)


您好!!!由于更新面板,我认为按钮的回发卡住...但你可以在这里绑定datalist代码,,,,



  public   void  btn_click()
{

da = new SqlDataAdapter( select ItemCode,ItemDesc,ItemCode +'-0 .jpg'为PicFileName,将(char,MRP,1)转换为MRP,将(char,OfferPrice,1)转换为OfferPrice,将DiscountPercent转换为Items,con);
dt = new DataTable();

da.Fill(dt);

DataList1.DataSource = dt;
DataList1.DataBind();
}


I have two update panels .In one update panel i have one link button & in other update panel i have datalist.When i click on link button of update panel one the how to bind the datalist on button click event.

解决方案

Call __dopostback(''updatepanel2'','''') for second update panel.

This will cause a partial postback to second updatepanel and in load event of page you can bind the control.

Hope this wud help :)


Hi!!! due to update panel i think postback of button is stuck... but you can bind datalist here the code ,,,,

public void btn_click()
  {

      da = new SqlDataAdapter("select ItemCode,ItemDesc, ItemCode + '-0.jpg' as PicFileName, convert(char, MRP,1) as MRP, convert(char,OfferPrice,1) as OfferPrice, DiscountPercent from Items", con);
      dt = new DataTable();

      da.Fill(dt);

      DataList1.DataSource = dt;
      DataList1.DataBind();
  }


这篇关于如何在第二个更新面板中更新datalist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆