I'm hoping some can help me out with a small problem I'm having.
I've got two frames - Frame1 and Frame2. Both have aspx pages (Primarily VB) loaded in them but to keep this explination simple, I'll refer to them by their frame names.
Frame1 has some text boxes. The user enters some values and clicks an asp button which then loads those values in session variables (Yea I know - bad me for using session variables).
All that is fine, but once the variables are loaded, I want to then call a VB Sub Procedure that is located in the aspx file that is loaded in Frame2. I know the sub procedure in frame2 works because to test it, I've added in a button on the page in frame2 that calls the procedure and it works fine.
What is the easiest way for me to execute the Sub Procedure located in frame2 as a result of a button click originating from frame1?
I've spent a few hours researching it on the net and from what I can see, I should be using some Java code to execute the procedure but I just cant seem to make those examples work in my situation.
If anyone has any suggestions, I would love to hear them.
Code is below...
Cheers
Dylan
Relevant code from the left frame:
Expand|Select|Wrap|Line Numbers
- Function makeCart()
- objDT = New System.Data.DataTable("Cart")
- objDT.Columns.Add("ID", GetType(Integer))
- objDT.Columns("ID").AutoIncrement = True
- objDT.Columns("ID").AutoIncrementSeed = 1
- objDT.Columns.Add("Quantity", GetType(Integer))
- objDT.Columns.Add("Product", GetType(String))
- objDT.Columns.Add("Price", GetType(Decimal))
- Session("Cart") = objDT
- End Function
- Sub loadvars(s As Object, e As EventArgs)
- Session("ddlProducts") = ddlProducts1.SelectedItem.Text
- session("Quantity") = txtQuantity.text
- session("UnitPrice") = ddlProducts1.SelectedItem.Value
- txtquantity.text = ""
- End Sub
Expand|Select|Wrap|Line Numbers
- Sub AddToCart(s As Object, e As EventArgs)
- objDT = Session("Cart")
- Dim Product = Session("ddlProducts")
- Dim blnMatch As Boolean = False
- For Each objDR In objDT.Rows
- If objDR("Product") = Product Then
- objDR("Quantity") += session("Quantity")
- blnMatch = True
- Exit For
- End If
- Next
- If not blnmatch then
- objDR = objDT.NewRow
- objDR("Product") = Session("ddlProducts")
- objDR("Quantity") = session("Quantity")
- objDR("Price") = session("UnitPrice")
- objDT.Rows.Add(objDR)
- end if
- Session("Cart") = objDT
- dg.DataSource = objDT
- dg.DataBind()
- Session("ddlProducts")= ""
- session("Quantity") = ""
- session("UnitPrice") = ""
- lblTotal.Text = "$" & GetItemTotal()
- End Sub