Seven price
asked on
ASP.NET VB, need to press a button twice to make something happen.
I got a web application, the problem is that the text in the label will not update on the first click, I need to click the button twice, I debugged to code, and I found out that the label does not receive the data until after the second click,
the button is built programatically
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
the button is built programatically
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually I just added it to the select statement for the validation check. But I will keep this one in my library for future reference.
Thanks.
Thanks.
ASKER
Call ShoppingCart2()
End sub
##########################
Public Function ShoppingCart2()
While sqlDR.Read
Dim btn As New Button
btn.Text = "Update" '& i
btn.ID = "mybutton" + cnt.ToString()
AddHandler btn.Click, AddressOf Btn_Click
c.Controls.Add(btn)
r.Controls.Add(c)
end while
End sub
###################### onclick button ##############
Private Sub Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim q As String = CType(FindControl("PrId" + value4), TextBox).Text
Dim h As String = CType(IfFindControl("txtqu
If ShoppingCartCompare(h) true Then
Response.write("good")
else
Response.write("bad")
end if
Open in new window