I have following global variables
Dim cardNumber As String
Dim txnAmount As String
Dim TerminalID As String
Dim CurrencyCode As String
And Values are assigned on a click Event from the result set returned from SP
dsCards = Utilities.GetVirtualResultNew(txtCardNumber.Text.Trim)
grdTransactionResultSearch.DataSource = dsCards
grdTransactionResultSearch.DataBind()
cardNumber = IIf(IsDBNull(dsCards.Tables(0).Rows(0).Item("pan")), "", dsCards.Tables(0).Rows(0).Item("pan"))
txnAmount = IIf(IsDBNull(dsCards.Tables(0).Rows(0).Item("TotalAmount")), "", dsCards.Tables(0).Rows(0).Item("TotalAmount"))
TerminalID = IIf(IsDBNull(dsCards.Tables(0).Rows(0).Item("TerminalID")), "", dsCards.Tables(0).Rows(0).Item("TerminalID"))
CurrencyCode = IIf(IsDBNull(dsCards.Tables(0).Rows(0).Item("CurrencyCode")), "", dsCards.Tables(0).Rows(0).Item("CurrencyCode"))
I Debugged the code and I can see the values are assigned to them but when I try to access them in another button click event, They are empty
Here is my button click event where These variables are empty
Protected Sub btnAuthorize_Click(sender As Object, e As EventArgs) Handles btnAuthorize.Click
Utilities.InsertAuthorizedTransactions(cardNumber, txnAmount, TerminalID, CurrencyCode)
Label1.Visible = True
END Sub
Whats the problem with my code?