943,981 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 653
  • ASP.NET RSS
Dec 26th, 2008
0

Methods Between Pages is This Possible

Expand Post »
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
ASP.NET Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Potato.Head is offline Offline
32 posts
since Dec 2008
Dec 27th, 2008
0

Re: Methods Between Pages is This Possible

Check this out. If it does not help, let the forum know.

http://msdn.microsoft.com/en-us/library/ms178139.aspx
Reputation Points: 13
Solved Threads: 2
Light Poster
poguemahone is offline Offline
25 posts
since Aug 2007
Dec 30th, 2008
0

Re: Methods Between Pages is This Possible

Reputation Points: 16
Solved Threads: 18
Junior Poster
Aneesh_Argent is offline Offline
104 posts
since Dec 2008
Jan 1st, 2009
0

Re: Methods Between Pages is This Possible

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();
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: given path's format is not supported -virtual directory problem-
Next Thread in ASP.NET Forum Timeline: How Can Inter relate two forms ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC