Repeater有一些信息页面Load时是收缩的 还有个LinkButton
<asp:Repeater ID="Repeater" Runat="server">
<table>
<tr id="line001" style="DISPLAY:none; VISIBILITY:hidden"></tr>
<asp:LinkButton ID="LinkButtonSave" Runat="server" CommandName="Save" text="确认"></asp:LinkButton>
</table>
</asp:Repeater>
希望点Button时收缩起来的信息保持展开状态 但报错没有对象
private void Repeater_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if(e.CommandName=="Save")
{
Response.Write("<script>alert('更改成功')</script>");
Response.Write("<script>window.document.getElementById('line001').style.display = 'block';</script>");
Response.Write("<script>window.document.getElementById('line001').style.visibility = 'visible';</script>");
}
}
<asp:Repeater ID="Repeater" Runat="server">
<table>
<tr id="line001" style="DISPLAY:none; VISIBILITY:hidden"></tr>
<asp:LinkButton ID="LinkButtonSave" Runat="server" CommandName="Save" text="确认"></asp:LinkButton>
</table>
</asp:Repeater>
希望点Button时收缩起来的信息保持展开状态 但报错没有对象
private void Repeater_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if(e.CommandName=="Save")
{
Response.Write("<script>alert('更改成功')</script>");
Response.Write("<script>window.document.getElementById('line001').style.display = 'block';</script>");
Response.Write("<script>window.document.getElementById('line001').style.visibility = 'visible';</script>");
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货