| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 411 人关注过本帖
标题:不具有名为“asp:templatecolumn”的属性
只看楼主 加入收藏
zsl5566
Rank: 1
来 自:泉州
等 级:新手上路
帖 子:163
专家分:0
注 册:2006-12-12
收藏
 问题点数:0 回复次数:1 
不具有名为“asp:templatecolumn”的属性

“/WebApplication1”应用程序中的服务器错误。
--------------------------------------------------------------------------------

分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。

分析器错误信息: 类型“System.Web.UI.WebControls.TemplateColumn”不具有名为“asp:templatecolumn”的属性。

源错误:


行 72: </itemtemplate>
行 73: </templatecolumn>
行 74: <asp:templatecolumn headertext="数量" headerstyle-borderstyle="double" headerstyle-borderwidth="4" itemstyle-borderstyle="double" itemstyle-borderwidth="4" itemstyle-horizontalalign="center">
行 75: <itemtemplate>
行 76: <asp:textbox runat="server" id="quantity" text='<%# container.dataitem("数量") %>' />

源文件: c:\inetpub\wwwroot\WebApplication1\shopping.aspx 行: 74


--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
--------------------------------------------
哪位高手帮帮忙.原始代码如下:
<%@ import namespace="system.data" %>
<%@ import namespace="system.data.oleDb" %>
<html>
<head>
<title>商品</title>
<script language="vb" runat="server">
Dim provider = "provider=microsoft.jet.oledb.4.0"
Dim database = "data source=" & Server.mappath("data.mdb")
dim 类型名称 as string, 类型编号 as integer
 Sub Page_Load(Sender As Object, E As EventArgs)
 类型名称 = request("类型名称")
 类型编号 = request("类型编号")
 if 类型编号 = 0 or 类型名称="" then
 response.redirect("index.aspx")
 end if
 if not ispostback then
Dim conn As oledbconnection, sql As String, i as integer,ds as dataset,adpt as oledbdataadapter
conn = New oledbconnection(provider & " ; " & database)
conn.open()
sql = "select * from 商品 where 类别=" & 类型编号
adpt= new oledbdataadapter (sql,conn)
ds = new dataset()
adpt.fill(ds,"商品")
dim table1 as datatable = ds.tables("商品")
table1.columns.add(new datacolumn("购买",gettype(boolean)))
table1.columns.add(new datacolumn("数量",gettype(integer)))
for i=0 to table1.rows.count-1
table1.rows(i).item("数量") = 1
next
mygrid.datasource = ds
mygrid.databind()
end if
End Sub
sub add_click(Sender As Object, E As EventArgs)
dim hash as hashtable,i as integer
if session("购物袋") is nothing then
hash = new hashtable
else
hash = session("购物袋")
end if
for i = 0 to mygrid.items.count-1
dim cb as checkbox = mygrid.items(i).findcontrol("buyit")
dim lb as label = mygrid.items(i).findcontrol("productid")
dim tb as textbox = mygrid.items(i).findcontrol("quantity")
if cb.checked and val(tb.text) > 0 then
if not hash.containskey(lb.text) then
hash.add(lb.text,cint(val(tb.text)))
else
hash(lb.text) += cint(val(tb.text))
end if
end if
next
session("购物袋") = hash
response.redirect("list.aspx")
end if
</script>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body bgcolor="#fffafo">
<form runat="server">
<center>
<font size="4"><%=类型名称%>.商品列表</font><hr size="1" color="royalblue">
<asp:datagrid runat="server" id="mygrid" borderstyle="double" borderwidth="4" backcolor="blanchedalmond" bordercolor="#999999"
headerstyle-backcolor="honeydew" headerstyle-forecolor="royalblue" headerstyle-horizontalalign="center" cellpadding="2" cellspacing="0" autogeneratecolumns="false">
<columns>
<asp:templatecolumn headertext="购买" headerstyle-borderstyle="double" headerstyle-borderwidth="4" itemstyle-borderstyle="double" itemstyle-borderwidth="4" itemstyle-horizontalalign="center">
<itemtemplate>
<asp:checkbox runat="server" id="buyit" text='<%# container.dataitem("购买") %>' />
</itemtemplate>
</templatecolumn>
<asp:templatecolumn headertext="数量" headerstyle-borderstyle="double" headerstyle-borderwidth="4" itemstyle-borderstyle="double" itemstyle-borderwidth="4" itemstyle-horizontalalign="center">
<itemtemplate>
<asp:textbox runat="server" id="quantity" text='<%# container.dataitem("数量") %>' />
</itemtemplate>
</templatecolumn>
<asp:templatecolumn headertext="编号" headerstyle-borderstyle="double" headerstyle-borderwidth="4" itemstyle-borderstyle="double" itemstyle-borderwidth="4" itemstyle-horizontalalign="center">
<itemtemplate>
<asp:label runat="server" id="productid" text='<%# container.dataitem("编号") %>' />
</itemtemplate>
</templatecolumn>
<asp:boundcolumn datafield="类别" headertext="类别" headerstyle-borderstyle="double" headerstyle-borderwidth="4" headertyle-horizontalalign="center" itemstyle-borderstyle="double" itemstylestyle-borderwidth="4" itemstyle-horizontalalign="center"/>
<asp:hyperlinkcolumn datatextfield="名称" headertext="名称" headerstyle-borderstyle="double" headerstyle-borderwidth="4" headertyle-horizontalalign="center" itemstyle-borderstyle="double" itemstylestyle-borderwidth="4" itemstyle-horizontalalign="left" datanavigateurlfield="连接" datanavigateurlformatstring="{0}" target="_blank"/>
<asp:boundcolumn datafield="价格" headertext="价格" headerstyle-borderstyle="double" headerstyle-borderwidth="4" headertyle-horizontalalign="center" itemstyle-borderstyle="double" itemstylestyle-borderwidth="4" itemstyle-horizontalalign="right"/>
<asp:boundcolumn datafield="简介" headertext="简介" headerstyle-borderstyle="double" headerstyle-borderwidth="4" headertyle-horizontalalign="center" itemstyle-borderstyle="double" itemstylestyle-borderwidth="4" itemstyle-horizontalalign="left"/>
</columns>
</asp:datagrid><p>
<asp:linkbutton runat="server" text="放入购物袋" onclick="add_click" />
<hr size="1" color="royalblue">
<table width=70%><tr>
<td align=center><a href="index.aspx">选择购物区</a></td>
<td align=center><a href="list.aspx">查看购物袋</a></td>
<td align=center><a href="exit.aspx">退回所有商品</a></td>
</tr></table>
</center>
</form>
</body>
</html>

搜索更多相关主题的帖子: 分析 应用程序 详细信息 源文件 资源 
2007-01-22 20:50
hoya
Rank: 5Rank: 5
等 级:贵宾
威 望:15
帖 子:538
专家分:0
注 册:2006-6-27
收藏
得分:0 
datagrid摸板列  标记有误吧...

妈的...一天能卖一颗就很不错了...
2007-01-22 21:48
快速回复:不具有名为“asp:templatecolumn”的属性
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020869 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved