62,074
社区成员
发帖
与我相关
我的任务
分享
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers ="true" UpdateMode ="conditional" >
<ContentTemplate >
<table width="500" border="0" cellpadding="3" cellspacing="1" bgcolor="#5aaE18">
<tr bgcolor="#FFFFFF">
<td width="38%" height="21"><div align="left" style="text-align: center"><strong> 标 题 </strong></div></td>
<td width="6%"><div align="center"><strong><span class="style13">发布人</span></strong></div></td>
<td width="7%"><div align="center"><strong>部 门</strong></div></td>
<td width="15%"><div align="center"><strong>时 间</strong></div></td>
<td width="8%"><div align="center"><strong>浏览</strong></div></td>
<td width="5%"><div align="center" class="style6"><strong>状 态</strong></div></td>
<td width="5%"><div align="center" class="style7"><strong>开 关</strong></div></td>
<td width="8%"><div align="center"><strong>操 作</strong></div></td>
</tr>
////////////////主要是一下代码,没有刷新~~~~
<%
IList<DSRS.Entity.sendword> swl;
if (lu.u_username == "admin")
{
swl = DSRS.BLL .sendwordBLL.Select(true, false);
}
else
{
swl = DSRS.BLL .sendwordBLL.Select(string.Format("sw_u_id='{0}'", lu.u_id), true, false);
}
string nu = lu.employee.em_name;
%>
<% foreach (DSRS.Entity.sendword sw in swl )
{
%>
<tr bgcolor="#FFFFFF" onmouseover ="this.style.backgroundColor='#EEEEEE'" onmouseout ="this.style.backgroundColor=''">
<td style ="text-align :left " ><img alt ="" src ='<%= ResolveUrl("~/images/tz/biaoti.gif") %>' /><a href ="tzneirong.aspx?id=<%= sw.sw_id %>"><%= sw.sw_title %></a>
</td>
<td ><div align ="center" ><%= nu %></div></td>
<td ><div align="center" ><%= sw.department .dept_department %></div></td>
<td ><div align="center" ><%= sw.sw_releasetime %></div></td>
<td><div align="center" ><%= sw.sw_reads %></div></td>
<td><div align="center" ><%if( sw.sw_state ==1) { %> <img alt ="" id ='<%=sw.sw_id+"**img1" %>' src ='<%= ResolveUrl("~/images/tz/close.gif")%>' /> <% } else
{ %> <img alt ="" id ='<%=sw.sw_id+"**img2" %>' src ='<%=ResolveUrl("~/images/tz/open.gif") %>' /> <% } %>
</div></td>
<td ><div align="center" id ='<%=sw.sw_id+"**div1" %>'><%
if (sw.sw_state == 0)
{
%><button type="button" onclick ="go1(this.id)" id ='<%=sw.sw_id+"**b1" %>' name ='<%=sw.sw_id+"**b1" %>'>关闭</button> <%
}
else
{
%><button type ="button" onclick ="go1(this.id)" id ='<%=sw.sw_id+"**b2" %>' name ='<%=sw.sw_id+"**b2" %>' >开通</button><%
}
%>
</div></td>
<td ><div align="center" ><button type ="button" onclick ="go3(this.id)" id='<%=sw.sw_id+"**b3" %>' name ='<%=sw.sw_id+"**b3" %>'>修改</button><br />
<button type ="button" onclick= "go2(this.id)" id='<%=sw.sw_id+"**b4" %>' name ='<%=sw.sw_id+"**b4" %>'>删除</button>
</div></td>
</tr>
<%
} %> </table>
</ContentTemplate>
</asp:UpdatePanel>
CS文件上:
sendwordBLL.Delete(id);
this.UpdatePanel1.Update();
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers ="true" UpdateMode ="conditional" >
<ContentTemplate >
<%
IList<DSRS.Entity.sendword> swl;
if (lu.u_username == "admin")
{
swl = DSRS.BLL .sendwordBLL.Select(true, false);
}
else
{
swl = DSRS.BLL .sendwordBLL.Select(string.Format("sw_u_id='{0}'", lu.u_id), true, false);
}
string nu = lu.employee.em_name;
%>
<% foreach (DSRS.Entity.sendword sw in swl )
{
%>
<tr bgcolor="#FFFFFF" onmouseover ="this.style.backgroundColor='#EEEEEE'" onmouseout ="this.style.backgroundColor=''">
<td style ="text-align :left " ><img alt ="" src ='<%= ResolveUrl("~/images/tz/biaoti.gif") %>' /><a href ="tzneirong.aspx?id=<%= sw.sw_id %>"><%= sw.sw_title %></a>
</td>
<td ><div align ="center" ><%= nu %></div></td>
<td ><div align="center" ><%= sw.department .dept_department %></div></td>
<td ><div align="center" ><%= sw.sw_releasetime %></div></td>
<td><div align="center" ><%= sw.sw_reads %></div></td>
</tr>
<%
} %>
</table>
</ContentTemplate>
</asp:UpdatePanel>