我想在单击按钮时刷新数据列表的行 [英] i want to refresh the row of datalist on button click

查看:124
本文介绍了我想在单击按钮时刷新数据列表的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在一个房地产经纪人站点项目上.当用户登录并单击管理属性"时,数据列表(编辑itemtemplate字段)中有一个名为刷新"的按钮.
我希望当我单击此按钮时,行将刷新,并显示一条消息,提示刷新"以及日期应随当前日期而改变.
请给我一些建议.












谢谢.

Hi,
I am working on a property dealer site project.when a user login and click on manage properties then there is a button named refresh in datalist (edit itemtemplate field).
I want that when i click on this button the row will refresh and a message show that "Refreshed" and also date should change with the present date.
Please give me suggestions to do it.












Thank You.

推荐答案

如果通过刷新表示该行中显示的数据列表数据必须更改,则必须使用
If you mean by refresh that the datalist data displayed in that row must change,then you must use
datalist.DataBind()

方法刷新数据列表.对于刷新消息,您可以为该按钮添加onclintclick并说出例如:

method to refresh the datalist.As for the message of refresh,you can add for this button an onclintclick and say for example :

onclientclick="window.alert("refreshed")"



希望对您有所帮助!



Hope that helps !


实施数据列表项命令事件
Implement Datalist Item Command event
DataList1_ItemCommand

,并在此事件中再次绑定数据列表.

请注意,如果数据列表"中有多个按钮,则为每个按钮提供命令并检查项目命令事件.喜欢:

and in this event bind Datalist again.

Note if you have more than one button in Datalist then provide command for each and check item command event. Like:

protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
   if (e.CommandName == "Refresh")
   {
      
   }
}


谢谢


这篇关于我想在单击按钮时刷新数据列表的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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