<%@ Page Language="C#"%><script Runat="Server">string strBackGroundColor = "white";void radlColors_SelectedIndexChanged( object s, EventArgs e )
{
strBackGroundColor = radlColors.SelectedItem.Text;
}</Script><html>
<head><title>RadioButtonAutoPostBack.aspx</title></head>
<body bgcolor="<%=strBackGroundColor%>"><form Runat="Server"><asp:RadioButtonList
ID="radlColors"
AutoPostBack="True"
OnSelectedIndexChanged="radlColors_SelectedIndexChanged"
Runat="Server" >
<asp:ListItem text="Red" />
<asp:ListItem text="Green" />
<asp:ListItem text="Blue" />
</asp:RadioButtonList></form></body>
</html>请问,当strBackGroundColor改变的时候,<body bgcolor="<%=strBackGroundColor%>">为什么能够被执行,是不是当change发生的时候,整个页面要重新从服务器上加载回来?
{
strBackGroundColor = radlColors.SelectedItem.Text;
}</Script><html>
<head><title>RadioButtonAutoPostBack.aspx</title></head>
<body bgcolor="<%=strBackGroundColor%>"><form Runat="Server"><asp:RadioButtonList
ID="radlColors"
AutoPostBack="True"
OnSelectedIndexChanged="radlColors_SelectedIndexChanged"
Runat="Server" >
<asp:ListItem text="Red" />
<asp:ListItem text="Green" />
<asp:ListItem text="Blue" />
</asp:RadioButtonList></form></body>
</html>请问,当strBackGroundColor改变的时候,<body bgcolor="<%=strBackGroundColor%>">为什么能够被执行,是不是当change发生的时候,整个页面要重新从服务器上加载回来?
这一句起着作用呢,自动提交,有没有加载你看IE状态条上有没有出现蓝色进度条(也许的机器配置很高的,根本看不到)