我在web用户控件使用了基类,出现错误。.cs里的
public partial class wucHead :PageBase.aspx里的
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wucHead.ascx.cs" Inherits="wucHead" %>错误:编译器错误消息: ASPNET: 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如 Page 或 UserControl)是正确的。行 12: public partial class wucHead :PageBase
public partial class wucHead :PageBase.aspx里的
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wucHead.ascx.cs" Inherits="wucHead" %>错误:编译器错误消息: ASPNET: 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如 Page 或 UserControl)是正确的。行 12: public partial class wucHead :PageBase
解决方案 »
- 为什么.ASPX中调用不了App_Code文件中类的公共方法?
- string a = string.Empty 和 string a=""的区别!!!
- aps.net如何实现快递单打印
- Tab 中的保存问题 !!!!!!!!!!!!!!!!!急 在线等
- $zxx$的正则怎么写???
- 请高手看看,下面的sql语句,第一个答对的给分,在线等
- 使用jmail时发生:异常详细信息: System.Runtime.InteropServices.COMException: DLL 中出错!
- 关于应用程序的日志问题?
- 请问在关闭IE时销毁所有的Session?
- 请大家提供几个学习ASP。NET的好网站,谢谢!
- 如何搜索到FTP方面的资源?
- 关于asp.net mvc和webform
protected static OleDbConnection conn;
protected static OleDbCommand cmd;
protected static OleDbDataReader dr;
protected static OleDbDataAdapter adapter;
public string strSQL;会提示变量不存在
/// <summary>
/// 将 cmdText 发送到 System.Data.SqlClient.OleDbCommand.Connection,并使用 System.Data.CommandBehavior 值之一生成一个 DataReader
/// </summary>
/// <param name="cmdTxt">安全的sql语句(string.format)</param>
/// <returns>一个 DataReader 对象</returns>
public static OleDbDataReader GetDataReader(string cmdTxt)
{
return GetDataReader(cmdTxt, null);
} /// <summary>
/// 将 cmdText 发送到 System.Data.SqlClient.OleDbCommand.Connection,并使用 System.Data.CommandBehavior 值之一生成一个 DataReader
/// </summary>
/// <param name="cmdTxt">安全的sql语句(string.format)</param>
/// <param name="pars">参数</param>
/// <returns>一个 DataReader 对象</returns>
public static OleDbDataReader GetDataReader(string cmdTxt, params OleDbParameter[] pars)
{
using (cmd = new OleDbCommand(cmdTxt, connectionstrings))
{
if (pars != null)
cmd.Parameters.AddRange(pars);
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
return dr;
}
}
public class PageBase : System.Web.UI.Page
使用在所有aspx页面的cs里用户控件定义是
public partial class wucHead : System.Web.UI.UserControl搜了一下,似乎用户控件要特别定义一个用户控件基类