ASP.NET AJAX学习

UpdatePanel外的按钮的时间要填充UpdatePanel内的GridView,要将该按钮注册为异步调用,如:
protected void Page_Load(object sender, System.EventArgs e)
{
    ScriptManager1.RegisterAsyncPostBackControl(ibGroupFind);
}
数据填充完后还要调用UpdatePanel.Update()
edgUser.DataBind();
upUserGrid.Update()




UpdatePanel中的控件执行后如果要弹出提示框,也需要注册
private void AlertMsg(UpdatePanel up, string sMsg)
{
      ScriptManager.RegisterStartupScript(up, this.GetType(), "alertmsg", "alert('" + sMsg + "')", true);
}

if (hRole.Value.Trim() == "" && hUserno.Value.Trim() == "")
{                
      AlertMsg(upOK, "请先选择源角色或用户");
      return;
}


如果页面需要使用脚本定位控件的位置,如果用到了div,则div要位于UpdatePanel的外面,以防止UpdatePanel刷新时控件的位置变化
<DIV id="divUser" style="DISPLAY: inline; Z-INDEX: 102; LEFT: 683px; OVERFLOW: auto; WIDTH: 336px; POSITION: absolute; TOP: 114px; HEIGHT: 413px; border-right: #ccccff 1px solid; border-top: #ccccff 1px solid; border-left: #ccccff 1px solid; border-bottom: #ccccff 1px solid;">
       <asp:UpdatePanel ID="upUserGrid" runat="server" UpdateMode="Conditional">               
       <ContentTemplate>                       
          <enjoyit:enjoyitdatagrid
      。。。。。。

转载于:https://www.cnblogs.com/DoNetBird/archive/2007/03/29/692791.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值