Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Usercontrol interacting with it's parent page?

Reply
Thread Tools

Usercontrol interacting with it's parent page?

 
 
John
Guest
Posts: n/a
 
      07-01-2003
Hi all,

Is it possible for a usercontrol to call a public method of a page it is
contained within? If so, how?

Regards
John.


 
Reply With Quote
 
 
 
 
Vaibhav
Guest
Posts: n/a
 
      07-01-2003
Hi

Since your page is a class too. In your user control you can create an
instance of it and then call its method.

But i also doubt on this being the best way and only way to do what u want
to do.

HTH


"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> Is it possible for a usercontrol to call a public method of a page it is
> contained within? If so, how?
>
> Regards
> John.
>
>



 
Reply With Quote
 
 
 
 
Naveen K Kohli
Guest
Posts: n/a
 
      07-01-2003
Every Control has a property named "Page". This gives you the refrence to
the containing page object. YOu can call public methods through this
refrence.

--
Naveen K Kohli
http://www.netomatix.com
"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> Is it possible for a usercontrol to call a public method of a page it is
> contained within? If so, how?
>
> Regards
> John.
>
>



 
Reply With Quote
 
PJ
Guest
Posts: n/a
 
      07-02-2003
Mark the method public static and pass any necessary state information as
arguments.

~PJ

"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> Is it possible for a usercontrol to call a public method of a page it is
> contained within? If so, how?
>
> Regards
> John.
>
>



 
Reply With Quote
 
Joe Agster
Guest
Posts: n/a
 
      07-02-2003
Yes, but you need to redefine the Page property from
within the user control to be of the type containing the
public method you want to access:

public class MyUC
inherits UserControl

protected readonly shadows property Page as MyPage
get
return ctype(mybase.Page, MyPage)
end get
end property

'... rest of class

'call method in containing page
Page.Method()

end class



>-----Original Message-----
>Hi all,
>
>Is it possible for a usercontrol to call a public method

of a page it is
>contained within? If so, how?
>
>Regards
>John.
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
C++.NET coding in window form client for interacting with WEb Serv =?Utf-8?B?ZGF2aWQ=?= ASP .Net 2 11-21-2005 11:29 PM
Interacting w/IOS Kev Cisco 2 09-27-2004 07:44 PM
interacting windows application =?Utf-8?B?bGF4bWk=?= ASP .Net 1 06-08-2004 12:10 PM
Interacting with Windows Services Timothy Parez ASP .Net 1 05-07-2004 01:19 AM



Advertisments