473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How To Expose Method From Ascx User Control

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
1 2910
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dh | last post by:
As a simple example, I can't seem to be able to reference a label called "lblOutput" that exists in my test.aspx page from within a User control, TestControl.ascx. I am stumped. Any help is...
5
by: Simon Harris | last post by:
Hi All, I am trying to call a method in a web form, from an event fired in a user control. My user control displays a map, which has a link button to enlarge/shrink the map. When the user...
3
by: runtoofar | last post by:
I have an ASCX user control with a drop down list inside an ASPX (C#) page. The user selects an item from the DDL, clicks a button, and the DDL.SelectedValue is supposed to be sent to another...
0
by: ElSchepo | last post by:
Hi, Just read http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/html/customcontrolfromusercontrol.asp on how to put User Controls (ascx) into an assembly. I made a...
1
by: Anonieko | last post by:
I know Visual Studio lacked support on easily writing code to raise events from a ascx user control ( because you have to hand write them)....
4
by: | last post by:
I'm building some user controls. I very much like how you can build custom properties to be bound to a user control, and how instances of that control will show those custom properties in the...
4
by: simon | last post by:
hello. relatively new to vb.net, i'm using VS 2003 and .net 2.0 i have a web app that i'm i have a user control that displays a simple 1 row table as the header of the page. the user control...
1
by: =?Utf-8?B?SlA=?= | last post by:
I have a default.aspx page. Default.aspx has placeholders. ASCX user controls are loaded into these placeholders at Page_Load. Each user control has a MultiView, within that there are two views...
0
by: erkbiz | last post by:
Hello, this is my first post, I hope this is the right forum to ask my question. I am dynamically loading a user control multiple times. I have a gridview and have inserted empty rows. Into these...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.