在asp.net中,当页面刷新时控件中显示的都是上次的记录,比如,文本框中是上次输入的东西,还有单选框和复选框也都是上次选中的,怎么才可以在页面刷新时就让他们全部清空呢?请高手指点,谢谢~~
解决方案 »
- 请教在.net中如何用js判断checkbox的选中数?
- html界面上的目录{操作}下面有二个操作{修改}{删除},这{修改}{删除}显示在左边,我想调这二个操作于中间,但是我实现不了,请问怎么办
- 迅雷登陆
- c# 读取JS 设置的Cookies 出现字符异常!
- sql server2005链接到服务器
- (Object/(DataSet,DataReader) Relational Mapping)ODRM模式更新20070131
- 如何将购物车的多条记录插入数据库
- “图片变幻显示控件”发布 + 今天再散200分,BS所有问问题给10分、20分的和小日本
- asp.net页面点击保存,内容修改成功后,跳转回本页面,页面内容还是没修改前内容,为什么会这样?
- 哪位大哥有架设IIS6.0的经验??200分求助
- 高手求救!!!!!又是动态控件--动态生成表格中的动态生成控件取值问题(附代码)
- 请介绍一本比较不错的JavaScript书,谢谢。
你取消他的ViewState
试试!设ViewState=False不过这样会不太正常!还可像CSdn这样
http://community.csdn.net/Expert/topic/3506/3506693.xml?temp=.8697321加一个无用的参数3506693.xml?temp=.8697321
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
protected void Page_Load(Object Src, EventArgs E)
{
}
</script>
<script runat="server">
protected void ok_Click(Object Src, EventArgs E)
{
string[] answer=new string[]{"A","B","C","D","D","AB"};
string[] t=new string[6];
t[0]=t1.SelectedItem.Value;
t[1]=t2.SelectedItem.Value;
t[2]=t3.SelectedItem.Value;
t[3]=t4.SelectedItem.Value;
t[4]=t5.SelectedItem.Value;
int score=0;
for(int j=0;j<t6.Items.Count-1;j++)
{
if(t6.Items[j].Selected)
t[5]=t[5]+t6.Items[j].Value;
}
for(int i=0;i<6;i++)
{
if(answer[i]==t[i])
score=score+10;
}
message.Text="您的成绩是:"+Convert.ToString(score);
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>在线考试系统</title>
</head>
<body>
<form name="form1" method="post" runat="server">
<p>1
<asp:RadioButtonList ID="t1" runat="server" TextAlign="left">
<asp:Listitem Value="A">A.</asp:ListItem>
<asp:Listitem Value="B">B.</asp:ListItem>
<asp:Listitem Value="C">C.</asp:ListItem>
<asp:Listitem Value="D">D.</asp:ListItem>
</asp:RadioButtonList>
</p>
<p>2.<asp:RadioButtonList ID="t2" runat="server" TextAlign="left">
<asp:Listitem Value="A">A.</asp:ListItem>
<asp:Listitem Value="B">B.</asp:ListItem>
<asp:Listitem Value="C">C.</asp:ListItem>
<asp:Listitem Value="D">D.</asp:ListItem>
</asp:RadioButtonList></p>
<p>3.<asp:RadioButtonList ID="t3" runat="server" TextAlign="left">
<asp:Listitem Value="A">A.</asp:ListItem>
<asp:Listitem Value="B">B.</asp:ListItem>
<asp:Listitem Value="C">C.</asp:ListItem>
<asp:Listitem Value="D">D.</asp:ListItem>
</asp:RadioButtonList></p>
<p>4.<asp:RadioButtonList ID="t4" runat="server" TextAlign="left">
<asp:Listitem Value="A">A.</asp:ListItem>
<asp:Listitem Value="B">B.</asp:ListItem>
<asp:Listitem Value="C">C.</asp:ListItem>
<asp:Listitem Value="D">D.</asp:ListItem>
</asp:RadioButtonList></p>
<p>5.<asp:RadioButtonList ID="t5" runat="server" TextAlign="left">
<asp:Listitem Value="A">A.</asp:ListItem>
<asp:Listitem Value="B">B.</asp:ListItem>
<asp:Listitem Value="C">C.</asp:ListItem>
<asp:Listitem Value="D">D.</asp:ListItem>
</asp:RadioButtonList></p>
<p>6.<asp:CheckBoxList ID="t6" runat="server" TextAlign="left">
<asp:Listitem Value="A">A.</asp:ListItem>
<asp:Listitem Value="B">B.</asp:ListItem>
<asp:Listitem Value="C">C.</asp:ListItem>
<asp:Listitem Value="D">D.</asp:ListItem>
</asp:CheckBoxList></p>
<p align="center"><asp:Button ID="tijiao" Text="交卷" OnClick="ok_Click" runat="server"/></p>
<asp:label ID="message" runat="server"/>
</form>
</body>
</html>
TextBOx.text = "";
不就可以了吗?