正在加载图片...
【演练41】下列代码实现了在页面首次加载时,填充列 表框 Listbox1中的各选项,而回发刷新时不重复加载 protected void Page_ Load(object sender, EventArgs e) Button1.'ext="引起回发";/设置按钮控件上显示的文 本 if( IsPostback)//如果页面的加载不是回发引起的,则 执行下列代码 Listbox1 Items. Add("教务处");//填充列表框中的选项 Listboxitems.Add("学生处"); Listbox1 Items. Ado("财务处");◼ 【演练4-1】 下列代码实现了在页面首次加载时,填充列 表框ListBox1中的各选项,而回发刷新时不重复加载。 ◼ protected void Page_Load(object sender, EventArgs e) ◼ { ◼ Button1.Text = "引起回发"; //设置按钮控件上显示的文 本 ◼ if (!IsPostBack) //如果页面的加载不是回发引起的,则 执行下列代码 ◼ { ◼ ListBox1.Items.Add("教务处"); //填充列表框中的选项 ◼ ListBox1.Items.Add("学生处"); ◼ ListBox1.Items.Add("财务处"); ◼ } ◼ }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有