分析器错误消息: 未能加载类型“InternetShopping.Proshow”。
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------
分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。
分析器错误消息: 未能加载类型“InternetShopping.Proshow”。
源错误:
行 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Proshow.aspx.cs" Inherits="InternetShopping.Proshow" %>
行 2:
行 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
源文件: /Proshow.aspx 行: 1
第一行<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Proshow.aspx.cs" Inherits="InternetShopping.Proshow" %>
下面是CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace InternetShopping
{
public partial class Proshow : System.Web.UI.Page
{
DataClassesDataContext db = new DataClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString.Count != 0)
{
Bind(); // 调用自定义方法Bind()绑定商品信息到gvProduct
}
}
private void Bind()
{
//获取选择的分类Id
if (Request.QueryString["CategoryId"] != null)
{
int categoryId = int.Parse(Request.QueryString["CategoryId"]);
//在Products表中查找满足条件的产品
var products = from p in db.Product
where p.CategoryId == categoryId
select p;
//将查找到的产品绑定到gvProduct
gvProduct.DataSource = products;
gvProduct.DataBind();
}
}
protected void gvProduct_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
//设置当前页索引值为新的页面索引值
gvProduct.PageIndex = e.NewPageIndex;
Bind(); // 调用自定义方法Bind()
}
}
}