By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,722 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,722 IT Pros & Developers. It's quick & easy.

How To Expose Method From Ascx User Control

P: n/a
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
Sep 27 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"Sylvie" <ss*@sss.sswrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>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

Sep 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.