即时数据绑定项目中的gettingerrors [英] im gettingerrors in data binding project
问题描述
嗨我得到错误... default.aspx.cs页
<前lang =cs> 使用系统;
使用 System.Collections.Generic;
使用 System.Linq;
使用 System.Web;
使用 System.Web.UI;
使用 System.Web.UI.WebControls;
命名空间 data_binding_in_asp.net
{
public partial class _Default:System.Web.UI.Page
{
protected void Page_Load( object sender,EventArgs e)
{
}
protected void Button1_Click( object sender,EventArgs e)
{
string c = string .Empty;
for ( int i = 0 ; i = CheckBoxlist1.items.count; i ++)
{
if (CheckBoxlist1.item [i] .Selected)
{
c + = CheckBoxlist1.item [i]。 value + - > + CheckBoxlist1.item [i] .text + <峰; br />中跨度>;
}
}
} Syntax错误: [ ^ ]
尝试此代码..
protected void Button1_Click( object sender,EventArgs e)
{
string c = string .Empty;
for ( int i = 0 ; i < CheckBoxlist1.Items.Count; i ++)
{
if (CheckBoxlist1.Items [i] .Selected)
{
c + = CheckBoxlist1.Items [i] .Value + - > + CheckBoxlist1.Items [i] .Text + <峰; br />中跨度>;
}
}
}
hi im getting errors in this ...default.aspx.cs page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace data_binding_in_asp.net
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string c = string.Empty;
for (int i = 0; i = CheckBoxlist1.items.count; i++)
{
if (CheckBoxlist1.item[i].Selected)
{
c += CheckBoxlist1.item[i].value + "-->" + CheckBoxlist1.item[i].text + "<br/>";
}
}
}
Syntax Error:[^]
try this code..
protected void Button1_Click(object sender, EventArgs e) { string c = string.Empty; for (int i = 0; i < CheckBoxlist1.Items.Count; i++) { if (CheckBoxlist1.Items[i].Selected) { c += CheckBoxlist1.Items[i].Value + "-->" + CheckBoxlist1.Items[i].Text + "<br/>"; } } }
这篇关于即时数据绑定项目中的gettingerrors的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!