A
Alexander Widera
Hi,
I have the following source code:
<%@ Register tagprefix="my" tagname="tcontrol" Src="article_small.ascx" %>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ShopConnectionString %>" SelectCommand="SELECT
AricleNumber FROM Articles;"></asp:SqlDataSource>
<asp:GridView ID="List1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<my:tcontrol runat=server ArticleNumber=<%# Eval("ArticleNumber") %> />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
With this I get the following errormessage:
"Databinding methods such as Eval(), XPath(), and Bind() can only be used
in
the context of a databound control."
But how can I realize that what I want? Is there a workaround?
Thanks,
Alex
I have the following source code:
<%@ Register tagprefix="my" tagname="tcontrol" Src="article_small.ascx" %>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ShopConnectionString %>" SelectCommand="SELECT
AricleNumber FROM Articles;"></asp:SqlDataSource>
<asp:GridView ID="List1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<my:tcontrol runat=server ArticleNumber=<%# Eval("ArticleNumber") %> />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
With this I get the following errormessage:
"Databinding methods such as Eval(), XPath(), and Bind() can only be used
in
the context of a databound control."
But how can I realize that what I want? Is there a workaround?
Thanks,
Alex