Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Natty Gur #1
Re: Firing user control event from parent control
Hi,
actually you don't need events. all you need is internal or public
function exposed by your inner user control(UCSub). you can call that
function from events on your hosted user contrl(UC):
1) add function in UCSub :
internal void UpdateData(string strData)
{
this.TextBox1.Text = strData;
}
2) add protected decleration of UCSub in UC :
protected WebUserControl2 UC2;
3) inside UC page_load load UCSub:
UC2 = (WebUserControl2)this.LoadControl("WebUserControl2 .ascx");
this.Controls.Add(UC2);
4) Call UCSub UpdateData method from any event in UC :
private void Button1_Click(object sender, System.EventArgs e)
{
UC2.UpdateData(TextBox1.Text);
}
HTH
Natty Gur[MVP]
blog : [url]http://weblogs.asp.net/ngur[/url]
Mobile: +972-(0)58-888377
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Composite Control - Event not firing in child control
Hello: I am experiencing an issue where I have a composite control (TestOuter) composed of more composite (TestInner) controls. When I am... -
Grid Control ItemData event not firing
I have a grid control on a page that I copied from another page and modified. For some reason it seem my ItemData event never fires. I even put... -
Control added programmatically not firing event
Hi, I'm loading a usercontrol with image buttons into a panel. When clicking the buttons the click event does not fire. Any suggestions Thanks... -
Know in user control page_load if an user control event is going to be fired
Hi all, i have built a user control that shows a map and let the user zoom in, out, usual stuff. Putting this object in a webform the user can... -
Dynamic Control Event Not Firing Help
In my ASP.NEt codebehind, I declare a public var for a DataGrid. Then in the TextChanged event handler for a TextBox, I create a <div> tag, stuff... -
davidgrover #2
Re: Firing user control event from parent control
You can raise an event in an ASP.NET page and capture or handle the event in one or more web user controls.
The following blog entry should help.
http://asp-net-elephant.blogspot.com/2011/02/capture-page-event-in-web-user-control.html
Junior Member
- Join Date
- Feb 2011
- Posts
- 2
-
davidgrover #3
Re: Firing user control event from parent control
You can raise an event in an ASP.NET page and capture or handle the event in one or more web user controls.
The following blog entry should help.
asp-net-elephant.blogspot.com/2011/02/capture-page-event-in-web-user-control.html
Junior Member
- Join Date
- Feb 2011
- Posts
- 2



Reply With Quote

