<% page language="c#" Codebehind="adt.aspx.cs" Inheriences="chaug.web.apply"%>请问Codebehind的属性代表是什么,Inheriences属性是用来做什么的?

解决方案 »

  1.   

    Codebehind 就是所谓的代码分离,这与先前的ASP有着很大的区别,将代码与表现分离出来,
    Inheriences就是指向的文件
      

  2.   

    Codebehind指存放后台代码的文件
      

  3.   

    Codebehind (就是所谓的代码分离,这与先前的ASP有着很大的区别,将代码与表现分离出来,)
    前台是你的.aspx文件,后台代码则是你的.cs文件
    Inheriences 就是要继承的类,一般是你的后台(Codebehind)文件的类名,如.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>.s
    public partial class Default3 : System.Web.UI.Page
    {
      

  4.   

    // 连接字符串
    string ConnStr = System.Configuration.ConfigurationSettings.AppSettings["ConnectionSqlServer"]; // 创建Connection对象
    SqlConnection myConn = new SqlConnection(ConnStr); // 创建Command对象并和Connection对象关联
    SqlCommand myCommand = new SqlCommand();
    myCommand.Connection = myConn;

    // 指定要执行的存储过程名称
    myCommand.CommandText = "CustomersProc";
    // 使用要执行的是存储过程
    myCommand.CommandType = CommandType.StoredProcedure; // 创建DataAdapter对象填充数据
    DataSet myDS = new DataSet();
    SqlDataAdapter adapter = new SqlDataAdapter(myCommand);
    adapter.Fill(myDS, "Customers"); // 将返回的数据和DataGrid绑定显示
    myDataGrid.DataSource = myDS.Tables["Customers"];
    myDataGrid.DataBind();
      

  5.   

    发错了地方,晕死
    顺便帮你答答
    Codebehind是指后台文件
    Inheriences为该文件对应后台类的命名空间及类名