Muhad Posted November 20, 2003 Posted November 20, 2003 I have a control to put on some of my web pages. This control needs to execute a subroutine that is on whatever page it is put on. So I press a button on this control to execute a subroutine on the qiven web page that the control is on. The problem is I can't find any way to execute the subroutine. I can't find a way to dereference the path to the subroutime. I am using VB.net 2003. I tried looking at the Page and Application objects but I see nothing to use. I would appreciate any help! Quote
Moderators Robby Posted November 20, 2003 Moderators Posted November 20, 2003 What is the circumstance of this? Generaly a user control shouldn't really know what goes on in a given page. Perhaps move the routine into a seperate class, that way you can have access to it from the user control. Quote Visit...Bassic Software
Shirtster Posted December 2, 2003 Posted December 2, 2003 Create a custom event in your usercontrol, passing any relevant data in the event, and handle it in your web form. The handler can do whatever it likes. http://www.ondotnet.com/pub/a/dotnet/2002/04/15/events.html covers creating your own events & delegates http://www.develop.com/conferences/conferencedotnet/materials/A8.pdf is a good quick PDF on creating events for web usercontrols Quote
Muhad Posted December 2, 2003 Author Posted December 2, 2003 Thanks guys. I will try out your ideas. Seems like either one will work ok. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.