即时数据绑定项目中的gettingerrors [英] im gettingerrors in data binding project

查看:51
本文介绍了即时数据绑定项目中的gettingerrors的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我得到错误... 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆