How To Expose Method From Ascx User Control

S

Sylvie

I have

an Aspx page (Name:"PG") (Contains "UC")

and

an Ascx Usercontrol (Name:"UC") (Contains "AspxGrid1")

I wanna expose Aspxgrid1.rowchanged event to Aspx Page, when user vhanges or
clicks on a row in usercontrol's grid, my page must catch this method and
after taking the row Id, It must redirect row id to another web user control

So I want to connect my 2 usercontrol, one is grid, the other is form of a
specific row

Could you give some code example ?

Thanks
 
K

Kevin Spencer

A UserControl is a Control. A Control may raise events. A Control may handle
events. An event is a message that is subscribed to. When you implement an
event handler in a Control, to handle an event from one of its child
Controls, the Control is subscribing to the event. It is telling the child
Control that when the Event happens, let me know. So, all the Control has to
do is subscribe to the Event, and raise its own Event to let any other
Control that wishes to know about the Event that the Event has occurred. In
other words, the Control subscribes to the Event message, and handles it by
passing it along to any other Control that may be interested.

Control A contains Control aa
Control aa has Event foo
Control A subscribes to Control aa Event foo
Control A implements its own Event bar
Control C subscribes to Control A Event bar
When Control A receives Event foo from Control aa, it raises Event bar
Control C receives Event bar from Control A

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top