在asp.net怎样做才能做到局部刷新 ?

前台:
<table border=1 cellspacing=1 id="ok" bgcolor="#CCFFFF">
<tr>
<td class="style1">

是否采血:</td>
<td class="style2">

<asp:DropDownList ID="DropDownList14" runat="server" Height="16px"
Width="160px" ontextchanged="DropDownList14_TextChanged"
AutoPostBack="True">
<asp:ListItem Selected="True">--请选择--</asp:ListItem>
<asp:ListItem>是</asp:ListItem>
<asp:ListItem>否</asp:ListItem>
</asp:DropDownList>

</td>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td class="style20">

是否应诊:</td>
<td class="style21">

<asp:DropDownList ID="DropDownList15" runat="server" Height="16px"
Width="160px" ontextchanged="DropDownList15_TextChanged"
AutoPostBack="True">
<asp:ListItem Selected="True">--请选择--</asp:ListItem>
<asp:ListItem>是</asp:ListItem>
<asp:ListItem>否</asp:ListItem>
</asp:DropDownList>

</td>

</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td class="style1">

是否完成 :</td>
<td class="style2">

<asp:DropDownList ID="DropDownList16" runat="server" Height="16px"
Width="160px" ontextchanged="DropDownList16_TextChanged"
AutoPostBack="True">
<asp:ListItem Selected="True">--请选择--</asp:ListItem>
<asp:ListItem>是</asp:ListItem>
<asp:ListItem>否</asp:ListItem>
</asp:DropDownList>

</td>

</tr>
<tr>
<td colspan="2">
 </td>
</tr>

</table>
后台里有判断,是根据dropdownlist 的textchange事件来判断。选一个是就会判断一下。可用了updatepanel就不判断了,哪个大虾能说一下么?谢谢!

第1个回答  2011-09-15
首先updatepanel是一个非常好用而且实用的控件。
不要用updatepanel把整个table全部包进去。可以将要刷新的内容回进去。
判断用的条件一定要放在updatepanel外面。追问

但。你一个表格怎么刷新一半呢。判断语句在表中。是根据表中的dropdownlist 判断的。这个表中有至少3个dropdownlist

追答

把dropdownlist的AutoPostBack属性设为true

追问

就是因为AutoPostBack属性为true.所以才要无刷新来实现 。我做的有2个表。一个大表一个小表。每个表中都有三个dropdownlist判断,现在我要做的是让dropdownlist判断而页面不要刷新 。但dropdownlist还是要刷新。就跟你说的那样,不要用updatepanel把整个table全部包进去。可以将要刷新的内容回进去。
判断用的条件一定要放在updatepanel外面。 这该怎么实现 ?

第2个回答  2011-09-15
微软自带updatepanel能别用就别用,用这个无刷新效果有时可能会失效,这个我遇到过
自己用ajax做吧 如果用jquery很简单,不会的话就用ajaxpro做,如果都不行的话 那就要赶快学学了,BS项目不用ajax用户体验不太好追问

能不能给点提示?就是相关联的一点源码 。你说的我都没有用过。谢谢

追答

可以 我以前在学校的时候写过ajax三级联动 代码在我电脑上呢 留个联系方式 下班我整理下给你

追问

QQ邮箱吧。先谢谢你了。等你的代码。
然后我说一下。我这个项目,是一个表。刷新 只要刷新 一部分就可以 了。有一部分判断的地方还是要刷新 ,不然就没法调用我写的js方法了。

追答

把你QQ留下 或者百度hi也行 那样方便些

追问

41250220 谢谢啊。邮箱[email protected]

本回答被提问者采纳
第3个回答  2011-09-15
jquery ajax刷新局部很简单。好久没做asp.net开发了。
做开发的你要不会用juqery就太落后了。不会用ajax你就不合格
第4个回答  2011-09-15
为什么用textchange
不用OnSelectedIndexChanged追问

有什么区别 啊。我是新手没有用过/

第5个回答  2011-09-15
用AJAX实现