XSLTファイルで表示されるアイテムごとに「カートに追加」ボタンを作成しようとしています。ボタンはサーバー(VB)で実行する必要があり、要求されたアイテムがカートに追加されるように、パラメーターをonlickに渡す必要があります。これは可能ですか?もしそうなら、どうすればいいですか?
やってみると
<asp:Button id="Button123"
Text="Add to Cart"
CommandName="AddToCart"
CommandArgument="123"
OnCommand="CommandBtn_Click"
runat="server"/>
「'asp'は宣言されていない名前空間です」と表示されます
私も試しました
<asp>
<xsl:attribute name="Button">id="BtnAddToCart"</xsl:attribute>
<xsl:attribute name="text">Add to cart</xsl:attribute>
<xsl:attribute name="CommandName">AddToCart</xsl:attribute>
<xsl:attribute name="CommandArgument">123</xsl:attribute>
<xsl:attribute name="Command">CommandBtn_Click</xsl:attribute>
<xsl:attribute name="runat">server"</xsl:attribute>
</asp>
エラーは発生しませんが、何もしません
課題の場合と同様に、製品を表示するためにXSLTを直接使用する必要がありますが、ここでやろうとしていることは課題の範囲を超えています。