Advertisement

04.29.2008 at 12:24PM PDT, ID: 23363263
[x]
Attachment Details

button event not firing in repeater control

Asked by bluefezteam in Microsoft Visual Basic.Net, Programming for ASP.NET, Visual Studio

Tags:

Hi,

I have a repeater control with a button control in the item template which isnt firing when clicked.

My .aspx code is as follows:

<asp:Repeater ID="rptProducts" runat="server" OnItemCommand="rptProducts_ItemCommand">
    <ItemTemplate>
        <%#Eval("name")%><br />
        <%#Eval("image")%><br />
        <%#Eval("Price")%><br />
        <asp:Button ID="btnAddBskt" runat="server" CommandName="Add" CommandArgument='<%#Eval("PID") %>' Text="add to basket" />
        <hr />
    </ItemTemplate>
</asp:Repeater>

my vb.net code is as follows:

    Protected Sub rptProducts_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles rptProducts.ItemCommand
        Dim PID As Integer
        PID = e.CommandArgument
    End Sub


Can anyone shed any light as to why it wont fire?Start Free Trial
[+][-]04.29.2008 at 12:49PM PDT, ID: 21465549

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 01:00PM PDT, ID: 21465646

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Programming for ASP.NET, Visual Studio
Tags: vb.net
Sign Up Now!
Solution Provided By: NazoUK
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.29.2008 at 01:17PM PDT, ID: 21465809

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628