Methods Between Pages is This Possible

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 30
Reputation: Potato.Head is an unknown quantity at this point 
Solved Threads: 0
Potato.Head's Avatar
Potato.Head Potato.Head is offline Offline
Light Poster

Methods Between Pages is This Possible

 
0
  #1
Dec 26th, 2008
Hi to all I'm new in the forum and also new in the ASP.Net programing.
I have the following question/problem:
I have a Page(lets say Page1.aspx) this page has the following code
  1. <iframe src="Page2.aspx" width="550" height="550"></iframe>

I was wandering If can declare methods/objects in the Page2.aspx and the Page1.aspx will know them.

My problem is that in Page2.aspx I do some work(lets say 2+2) and then I want to Page1.aspx to get the result from Page2.aspx (ofcourse the 2+2 is a simplify example).
If this is possible how is this done, maybe you have a link where I can see an example.
Thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 25
Reputation: poguemahone is an unknown quantity at this point 
Solved Threads: 2
poguemahone's Avatar
poguemahone poguemahone is offline Offline
Light Poster

Re: Methods Between Pages is This Possible

 
0
  #2
Dec 27th, 2008
Check this out. If it does not help, let the forum know.

http://msdn.microsoft.com/en-us/library/ms178139.aspx
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 104
Reputation: Aneesh_Argent is an unknown quantity at this point 
Solved Threads: 18
Aneesh_Argent Aneesh_Argent is offline Offline
Junior Poster

Re: Methods Between Pages is This Possible

 
0
  #3
Dec 30th, 2008
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Methods Between Pages is This Possible

 
0
  #4
Jan 1st, 2009
No, this is not possible the way you are wanting. If you wish to do this, you would have to do a cross-page postback, then redirect back to the current page. So by doing this, you will make these functions somewhat unique to each page. Therefore you might as well make them into a class (a file with common code) and call it from there, or duplicate each function on each page. Repeated code is only hard for the programmer, as the viewer does not download extra code, use extra bandwidth, etc. It's just more difficult to maintain. My recommendations would be just to have the function on each page, unless you will be using it more than 2 or 3 times. If so, put it into a class, and place a reference to the class in your site. Call the class by calling: ClassName obj = new ClassName(); Then call your method within that class: obj.methodCall();
I answer pm's.
I answer questions.
I answer quickly.
I answer.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC