<% page language="c#" Codebehind="adt.aspx.cs" Inheriences="chaug.web.apply"%>请问Codebehind的属性代表是什么,Inheriences属性是用来做什么的?
解决方案 »
- 关于.Net MVC跳转问题。急。 在线等
- vs2008调试正常,iis发布 有误
- 页面中字符串添加问题
- 针对不同的结果,a页面有不同的显示。
- 简单的数据绑定的错误 通过数据绑定错误在那里呢?usersf是个<DropDownList>控件的名称
- 从Web.Config中读取数据库连接字符串的问题
- 配置wrox的经典程序thephile(c#)出错,急急急!!!!!!!!!
- 自学该怎样学?
- 问你一个WEB项目不能调试的问题?
- 页面中,如和存储一个数组,在第二次处理时要使用到.在线等待,谢谢!
- 关于CheckBox的问题,请教高手。。。。。
- “/asp.netwebadminfiles”应用程序中的服务器错误"
Inheriences就是指向的文件
前台是你的.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
{
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();
顺便帮你答答
Codebehind是指后台文件
Inheriences为该文件对应后台类的命名空间及类名