Gridview在后台无法显示在问
我是新手,正在学vs2005, 我再用gridview时发现我页面声明的gridview1在该页面的cs中找不到,用this.GridView1也不行,就无法调用Gridview1的功能,如果把Gridview1写在cs程序里,调试错误:当前上下文中不存在名称“Gridview1”
我是不是少引用了什么还是哪出错了,希望帮我解决一下,谢谢
aspx:
<asp:GridView ID= "GridView1 " runat= "server " AllowPaging= "True " AllowSorting= "True " AutoGenerateDeleteButton= "True " AutoGenerateEditButton= "True ">
<Columns>
<asp:BoundField DataField= "ST_Student_id " HeaderText= "学号 " ReadOnly= "True " />
<asp:BoundField DataField= "ST_Student_name " HeaderText= "姓名 " />
<asp:BoundField DataField= "ST_Student_sex " HeaderText= "性别 " />
<asp:BoundField DataField= "ST_Student_nation " HeaderText= "民族 " />
<asp:BoundField DataField= "ST_Student_birthday " HeaderText= "出生日期 " />
<asp:BoundField DataField= "ST_Student_time " HeaderText= "入学时间 " />
<asp:BoundField DataField= "ST_Student_classid " HeaderText= "班级 " />
<asp:BoundField DataField= "ST_Student_home " HeaderText= "生源 " />
<asp:BoundField DataField= "ST_Student_else " HeaderText= "备注 " />
</Columns>
</asp:GridView>
cs的引用
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
------解决方案--------------------Gridview1
==>
GridView1 注意大小写
------解决方案--------------------你文件有没有改名
------解决方案--------------------Gridview1 不是告诉过你注意大小写了吗。