页面上有个 datalist 我放了一个 linkbutton 编辑铵扭  当我点击的时候 弹出当前点击的ID的数据  并进行编辑  大家怎么实现

解决方案 »

  1.   

    微软的ajax组件有弹出的控件,你下个ajax的组件,开发时实现一些功能就容易多了
      

  2.   

    用js 显示 或隐藏 Div
            <asp:DataList ID="DataList1" runat="server">
            <ItemTemplate>
            
                <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
                <div id = "MyDiv" style="display:none"><%#DataBinder.Eval(Container.DataItem,"ID"%></div>
                </ItemTemplate>
            </asp:DataList>
      

  3.   

    linkbutton 事件里写类似Response.Write("alert('something')")的语句
      

  4.   

    JS弹出对话框:Prompt
    我是这么实现的,不过这个方法有一点不好,弹出的位置不能固定
      

  5.   

    要不这样做。
    点击linkbutton时用windows.open()打开一个没有地址栏,没有状态栏的子窗口. 将ID传过去.在打开的页面上进行详细资料的修改,修改完成,自动返回到上一页面,并关闭。
    父页面:点击linkbutton时打开另一页面  window.open(url,'更新','width=720,Height=550,scrollbars=yes,resizable=yes');
    子页面修改完成:
    Response.Write("<script>alert('修改成功')</script>");
    Response.Write("<script>window.opener.location=window.opener.location; window.close();</script>");
      

  6.   

    点击LinkButton把数据绑定到层里
    下面是让父窗口不可编辑的代码
    <html>
    <head>
        <script>   
      function   locking(){   
      document.all.ly.style.display="block";   
      document.all.ly.style.width=document.body.clientWidth;   
      document.all.ly.style.height=document.body.clientHeight;   
      document.all.Layer2.style.display='block';   
      }   
      function   Lock_CheckForm(theForm){   
      document.all.ly.style.display='none';document.all.Layer2.style.display='none';
      return   false;   
      }   
        </script></head>
    <body>
        <img src="http://powereasy.net/skin/since07/images/sf_cms_banner1.jpg">
        <p align="center">
            <input type="button" value="系统锁定" onclick="locking()">
        </p>
        <div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;
            z-index: 2; left: 0px; display: none;">
        </div>
        <!--         浮层框架开始         -->
        <div id="Layer2" align="center" style="position: absolute; z-index: 3; left: expression((document.body.offsetWidth-540)/2); top: expression((document.body.offsetHeight-170)/2);
            background-color: #fff; display: none;" >
            <table width="540" border="0" cellpadding="0" cellspacing="0" style="border: 0   solid   #e7e3e7;
                border-collapse: collapse">
                <tr>
                    <td style="background-color: #73A2d6; color: #fff; padding-left: 4px; padding-top: 2px;
                        font-weight: bold; font-size: 14px;" height="27" valign="middle">
                        [&nbsp;警&nbsp;告&nbsp;]
                    </td>
                </tr>
                <tr>
                    <td height="130" align="center">
                        <input type="button" value=" 确定 " onclick="Lock_CheckForm(this);">
                    </td>
                </tr>
            </table>
        </div>
        <!--         浮层框架结束         -->
    </body>
    </html>
      

  7.   

    LinkButton 设置可commandName和CommandArgument
    在Datalist的Command事件里写绑定代码