473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Execute a procedure from a button click located on a different frame /page

Hey,

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
  1.     Function makeCart()
  2.         objDT = New System.Data.DataTable("Cart")
  3.         objDT.Columns.Add("ID", GetType(Integer))
  4.         objDT.Columns("ID").AutoIncrement = True
  5.         objDT.Columns("ID").AutoIncrementSeed = 1
  6.         objDT.Columns.Add("Quantity", GetType(Integer))
  7.         objDT.Columns.Add("Product", GetType(String))
  8.         objDT.Columns.Add("Price", GetType(Decimal))
  9.         Session("Cart") = objDT
  10.     End Function
  11.  
  12.               Sub loadvars(s As Object, e As EventArgs)
  13.  
  14.             Session("ddlProducts") = ddlProducts1.SelectedItem.Text
  15.             session("Quantity") = txtQuantity.text
  16.             session("UnitPrice") = ddlProducts1.SelectedItem.Value
  17.  
  18.             txtquantity.text = ""
  19.  
  20.              End Sub
  21.  
Relevant code from the right frame:
Expand|Select|Wrap|Line Numbers
  1.          Sub AddToCart(s As Object, e As EventArgs)
  2.  
  3.                   objDT = Session("Cart")
  4.                   Dim Product = Session("ddlProducts")
  5.  
  6.               Dim blnMatch As Boolean = False
  7.  
  8.               For Each objDR In objDT.Rows
  9.                   If objDR("Product") = Product Then
  10.                        objDR("Quantity") += session("Quantity")
  11.                        blnMatch = True
  12.                        Exit For
  13.                   End If
  14.               Next
  15.  
  16.                   If not blnmatch then
  17.                   objDR = objDT.NewRow
  18.                   objDR("Product") = Session("ddlProducts")
  19.                   objDR("Quantity") = session("Quantity")
  20.                   objDR("Price") = session("UnitPrice")
  21.                   objDT.Rows.Add(objDR)
  22.                   end if
  23.  
  24.                   Session("Cart") = objDT
  25.  
  26.                   dg.DataSource = objDT
  27.                   dg.DataBind()
  28.  
  29.             Session("ddlProducts")= ""
  30.             session("Quantity") = ""
  31.             session("UnitPrice") = ""
  32.  
  33.               lblTotal.Text = "$" & GetItemTotal()
  34.  
  35.               End Sub
  36.  
Nov 9 '06 #1
0 1348

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Phil Grimpo | last post by:
I had previously explained this problem in a different thread, but now that I have an IISState log, I figured I'd re-start the thred. My situation and the log are following... I have a very odd...
6
by: Rod Snyder | last post by:
I'm trying to set up a page with an asp.net link button that would send a user to a certain page and on page load execute a specific stored procedure tied to the button on the previous page. The...
3
by: Robin | last post by:
Hi, I have a question: If I have a frameset, frame1 and frame2. On frame2 I have a datagrid, on which I can add/update/delete rows. If I submit that page, I catch these changes in events and...
4
by: Ian Kelly | last post by:
Hi All, I have an .net form that is split into two frames. The left frame has a tree that displays a list of all the customers. The right frame displays the appropriate clients information. ...
21
by: Ben | last post by:
Hello I have frames set up in an asp.net application and need one frame to refresh another. Seeing as events need to be registered at the time the page is sent from the server, I was wondering...
1
by: Kuldeep | last post by:
Hello All, Visual Studio 2005 ASP.NET 2.0 C#.NET 2.0 I have an application which has a Button click event procedure as given below. protected void btn_Click(object sender, EventArgs e)
4
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't...
8
by: rengaraj | last post by:
Dear Experts, In my html page i use an frame by clicking the button on right frame the left frame src should change. It changes but the statements after reload are not executed My Pbm How to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.