Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0122: 'System.Web.UI.WebControls.RepeaterItem.dataItem' is inaccessible due to its protection levelSource Error: Line 39: <span class="style2"> 编号:1 发布时间:2004-09-04 发布者:Admin</span></td>
Line 40: <td width="13%">1</td>
Line 41: <td><%#Databinder.Eval(Container.dataItem,"Fname")%></td>
Line 42: </tr>
Line 43: </table>
Source File: http://localhost/mstcweb/web/Resources/List.aspx Line: 41
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0122: 'System.Web.UI.WebControls.RepeaterItem.dataItem' is inaccessible due to its protection levelSource Error: Line 39: <span class="style2"> 编号:1 发布时间:2004-09-04 发布者:Admin</span></td>
Line 40: <td width="13%">1</td>
Line 41: <td><%#Databinder.Eval(Container.dataItem,"Fname")%></td>
Line 42: </tr>
Line 43: </table>
Source File: http://localhost/mstcweb/web/Resources/List.aspx Line: 41
解决方案 »
- .NET直接下载一个文件,而不是在IE中打开它应该怎么做?
- Flashpaper.exe为何在win2003中,asp.net编程下,启动不了
- 问一个正则表达式,只能输入中文、英文或者数字,或者三者的混合,其他字符不能输入
- 各位老大师傅请指点!!!小弟关于网页对话框的,在线等!!!!
- asp.net mvc 2 的部署问题?
- 关于页面传值,有哪几种方法
- Access数据库中,如何在插入一条记录之后将该记录中自动生成的ID取出来返回?
- 请问C#后台如何解析JSON
- 怎么得到connectionString??
- 为什么我将水晶报表9.2安装完毕后,向网页中添加水晶报表控件的时候
- 想请教一个简单的问题,我刚学,
- 怎么查看自己所有未结贴的贴子呀?
Repeater?还是数据源什么的?
請查看數據源中"Fname"是否正常.
private void Page_Load(object sender, System.EventArgs e)
{
// IList sortList = null;
// BLL.Sort sort = new Sort();
// sortList = sort.GetSortByParentId(1,1);
DataSet dSet = new DataSet();
DataTable dTable = MakeNamesTable();
Repeater1.DataSource = dTable;
Repeater1.DataBind();
// Put user code to initialize the page here
}
private void CreateNewDataRow()
{
// Use the MakeTable function below to create a new table.
DataTable myTable;
myTable = MakeNamesTable();
// Once a table has been created, use the NewRow to create a DataRow.
DataRow myRow;
myRow = myTable.NewRow();
// Then add the new row to the collection.
myRow["fName"] = "John";
myRow["lName"] = "Smith";
myTable.Rows.Add(myRow);
foreach(DataColumn dc in myTable.Columns)
Console.WriteLine(dc.ColumnName);
Repeater1.DataSource=myTable;
}
private DataTable MakeNamesTable()
{
// Create a new DataTable titled 'Names.'
DataTable namesTable = new DataTable("Names");
// Add three column objects to the table.
DataColumn idColumn = new DataColumn();
idColumn.DataType = System.Type.GetType("System.Int32");
idColumn.ColumnName = "id";
idColumn.AutoIncrement = true;
namesTable.Columns.Add(idColumn);
DataColumn fNameColumn = new DataColumn();
fNameColumn.DataType = System.Type.GetType("System.String");
fNameColumn.ColumnName = "Fname";
fNameColumn.DefaultValue = "Fname";
namesTable.Columns.Add(fNameColumn);
DataColumn lNameColumn = new DataColumn();
lNameColumn.DataType = System.Type.GetType("System.String");
lNameColumn.ColumnName = "LName";
namesTable.Columns.Add(lNameColumn);
// Create an array for DataColumn objects.
DataColumn [] keys = new DataColumn [1];
keys[0] = idColumn;
namesTable.PrimaryKey = keys;
// Return the new DataTable.
return namesTable;
}
<%#Databinder.Eval(Container.dataItem,"Fname")%>
查看是否有定義Fname.