【发布时间】:2015-10-26 19:54:50
【问题描述】:
我是初学者是 ASP.NET。我有一个小疑问。我写了一个简单的代码来打印文本框中选中的单选按钮的文本。我没有使用单选按钮的自动回发属性。代码如下
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace web
{
public partial class SAMPLE : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton1.Checked)
TextBox1.Text = RadioButton1.Text;
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton2.Checked)
TextBox1.Text = RadioButton2.Text;
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
}
检查单选按钮,单选按钮中的文本不会打印在文本框中,而是在点击按钮后打印。 我的疑问是在回发期间(点击按钮)只有按钮控件事件处理程序中的内容被执行,但是其他事件处理程序中的语句是如何被执行的?
【问题讨论】:
-
发布你的aspx代码,可能你已经交换了事件