作者erho (ptt访客)
看板C_Sharp
标题[请益] 请问ASP.NET Autopost的问题
时间Tue Aug 29 12:12:34 2006
我将checkboxlist、radiobuttonlist、dropdownlist、listbox使用AutopostBack属性,
变换选取项目後将文字显现在literal上,但dropdownlist跟listbox没有将文字显示在
literal上,但若将该两项用button点选便有显示在literal上,想请教大大这是什麽缘故
我是用Visual studio 2005编译的
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.Literal1.Text = this.CheckBoxList1.Text;
}→literal有显示出来
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.Literal1.Text = this.RadioButtonList1.Text;
}→literal有显示出来
protected void Button1_Click(object sender, EventArgs e)
{
this.Literal1.Text = this.DropDownList1.SelectedValue;
}→literal有显示出来
protected void Button2_Click(object sender, EventArgs e)
{
this.Literal1.Text = this.ListBox1.Text;
}→literal有显示出来
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.Literal1.Text = this.DropDownList1.Text;
}→literal无显示
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
this.Literal1.Text = this.ListBox1.SelectedValue;
}→literal无显示
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.223.243.227
1F:推 tomex:应该是不会,你用debug一行一行跑试看看,语法准确性要高 08/30 01:31