Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6027073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:32:15+00:00 2026-05-23T04:32:15+00:00

hello everyone i struggling to pass two parameter to an event handler basically when

  • 0

hello everyone i struggling to pass two parameter to an event handler basically when the page is load it dynamically create some control lable, textfield, and linkbutton when i click on the link button it fire an event handler, here is my problem i want to pass first the Product ID and quantity, the product id is fetch from the database passit thorugh an object where as the quantity it enter by the user

first part of the code it connect to database loop through and display all record on the page dynamcally


Function test()

    Dim objTemlDall As New Dallyarer
    arr = objTemlDall.getRecord()

    Dim lblname As Label
    Dim lblDes As Label
    Dim lblPrice As Label
    Dim linkItem As LinkButton


    Dim objTemProduct As Product
    For Each objTemProduct In arr

        lblname = New Label
        lblDes = New Label
        lblPrice = New Label
        linkItem = New LinkButton
        txtQuantity = New TextBox




        PrdName.Controls.Add(New LiteralControl("<br />"))
        lblname.Text = objTemProduct.Name
        PrdName.Controls.Add(lblname)
        PrdName.Controls.Add(New LiteralControl("<br />"))

        PrdDesc.Controls.Add(New LiteralControl("<br />"))
        lblDes.Text = objTemProduct.ShortDescription
        PrdDesc.Controls.Add(lblDes)
        PrdDesc.Controls.Add(New LiteralControl("<br />"))

        PrdPrice.Controls.Add(New LiteralControl("<br />"))
        lblPrice.Text = objTemProduct.UnitPrice
        PrdPrice.Controls.Add(lblPrice)
        PrdPrice.Controls.Add(New LiteralControl("<br />"))

        PrdQuantity.Controls.Add(New LiteralControl("<br />"))
        txtQuantity.ID = "qty"
        PrdQuantity.Controls.Add(txtQuantity)

        PrdQuantity.Controls.Add(New LiteralControl("<br />"))



        linkItem.Text = "Add to Cart"
        linkItem.ID = objTemProduct.ProductID
        linkItem.CommandArgument = objTemProduct.ProductID
        PrdAddToCart.Controls.Add(New LiteralControl("<br />"))
        PrdAddToCart.Controls.Add(linkItem)
        PrdAddToCart.Controls.Add(New LiteralControl("<br />"))

        AddHandler linkItem.Click, AddressOf GetSelectedProduct

    Next objTemProduct

End Function

second part when it fire event handler i want to pass txtQuantity data to GetSelectedProduct event handler how can i achieve that please

Function GetSelectedProduct(ByVal sender As Object, ByVal e As EventArgs)

    SelectedProduct = New Product
    Dim lbLink As LinkButton = CType(sender, LinkButton)
    SelectedProduct.ProductID = lbLink.CommandArgument



    Dim objTemlCart As New Dallyarer
    arr = objTemlCart.getRecord()

    Dim objT As Product

    For Each objT In arr
        If objT.ProductID = SelectedProduct.ProductID Then
            SelectedProduct.ProductID = objT.ProductID
            SelectedProduct.Name = objT.Name
            SelectedProduct.UnitPrice = objT.UnitPrice
        End If
    Next objT


    If Page.IsValid Then
        Dim CartItem As New CartItem
        CartItem.Product = SelectedProduct
        'CartItem.Quantity = CType(Me.txtQuantity.Text, Integer)
        Me.AddToCart(CartItem)
    End If


End Function

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:32:16+00:00Added an answer on May 23, 2026 at 4:32 am

    Try this:

    object.addEventListener(FlexEvent.MouseEvent, function
       (e:MouseEvent) : void {
    doSomething(param1, param2);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everyone I'm trying to improve my Java skills by solving some problems from
Hello everyone and thank you very much for your time. Basically what I am
Hello everyone iam trying to open a aspx page in a dialog box window
Hello everyone i need some help. I'm trying to make an application for mac
Hello Everyone and Good Morning, I am working with the page: http://702wedding.com/live/ And it
Some details XAMPP 1.7.1 OS tested on vista and xp Hello everyone. I have
Hello everyone I'm currently trying to create a deferred renderer for my graphics engine
Hello everyone I got trapped when Im using jquery loading some content into my
Hello everyone I am trying to resize an image of 700kb with imagecreatefromjpeg. This
Hello everyone I'm currently having 2 issues with the code below: Upon return of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.