Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling page method from usercontrol
Message
From
22/08/2002 10:42:25
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00692278
Message ID:
00692455
Views:
14
Regardis this, I would use a diferent Aproach to this issue. Actually I'm using it.

Declare your webusercontrol WITHEVENTS on your webpage. On your webusercontrol, declare an event, and raise it, instead of calling a method on your page.

Capture the event on your page, and process it.

Example:

On WebUserControl

Public Event DoAction(Action as Integer)

On page:

Private Withevents MyControl as MyControlClass = Nothing



Private Sub MyControl_DoAction(Action as integer) Handles MyControl.DoAction

Select Case Index
Case 0
' Do something
Case 1
' Do another
End Select

End Sub



Or you can of course define an event for each action individually. That may be a better option. The ideia is the same, but with an event for each action.

Hope ths helps

Regards,

João Cardoso
Previous
Reply
Map
View

Click here to load this message in the networking platform