1

这是我的问题。

我有一个中继器。里面有很多文本框。在最右边的列中,有一个链接按钮。单击此链接按钮将显示一个 modalpopupextender,它将显示所选行的详细记录。

我让它工作得很好,但它很慢,因为当你点击链接按钮时,它会刷新整个页面。

我不想重新加载中继器,因为这是非常慢的部分。

我尝试添加一个 updatePanel(updatePanel 内的中继器),但当然,由于中继器位于 updatePanel 内,它仍会重新加载中继器。

所以问题是,我该怎么做,当点击链接按钮时,它不会重新加载转发器......

任何想法将不胜感激。顺便说一句,我正在使用 .net 2.0、c# 开发它

4

3 回答 3

1
Try this one.

<asp1:UpdatePanel ID="updatepanel4" runat="server" >
<ContentTemplate>
 <table id="AssignedRequest" class="tablecont" runat="server" style="width: 900px;" >
 <tr>
   <td>
  <div style=" display:block; width:900px; height:350px;overflow:scroll; ">
    <asp:Repeater runat="server" ID="RepeaterRequest"> 
     <HeaderTemplate >
     <table class="list_table" border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <th>Name</th>
        <th></th>
    </tr>
</HeaderTemplate>
<ItemTemplate>
  <tr>
    <td><%# Eval("NAME")%></td>

<td><a onclick="window.open(this.href,this.target,'directories=no,
     menubar=no,resizable=no,scrollbars=1,
     status=no,toolbar=no,addressbar=no,fullscreen=yes'); 
     return false;" href="View.aspx?name=<%#Eval("NAME")%>">View</a></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>

</FooterTemplate>
</asp:Repeater>
</div>
</td>
 </tr>
</table>
 </ContentTemplate>
</asp1:UpdatePanel>
于 2012-09-10T12:28:21.363 回答
0

Why not go for something like a master-child relationship. Do you require further interaction with the child data you are showing to the user? Please specify the nature if so.

Assuming that the child data that you are going to show is simple data meant to simply convey related data to user, you can go for a combination jQuery, and repeaters to accomplish your objective.

The first repeater you show your master data. Against each row in your repeater you show a show button here. You do not need a linkbutton here; just a simple anchor will do. You'd have to write js in it to toggle the correct child data.

All the child data should also be repeated. But not shown to the user at first. Only that particular child item should be shown - this is suitably triggered by the show anchor which is clicked on the master repeater. Rest is all js/css.

Below is a link to a sample project which demonstrates the concept.

http://www.coderun.com/ide/?w=2ObqOpjZz0qt7OrXYmmxwA

于 2012-09-08T07:32:08.043 回答
0

在后面的代码中注册,此代码在您绑定后添加,例如在您的 Page_Load 中,(您也可以使用 ItemDataBound 或 ItemCreated 委托)。

        rpt.DataBind();
        foreach (RepeaterItem ri in rpt.Items)
        {
            if (ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem)
            {
                LinkButton lnkButton1 = (LinkButton)ri.FindControl("lnkButton1");
                ScriptManager1.RegisterAsyncPostBackControl(lnkButton1);
            }
        }
于 2012-09-03T14:34:31.607 回答