Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to capture dynamically a button click on a usercontrol, and in page?

Reply
Thread Tools

How to capture dynamically a button click on a usercontrol, and in page?

 
 
davidr@sharpesoft.com
Guest
Posts: n/a
 
      08-30-2006
Hi,

I've read about bubble events and setting up the event args and several
other methods to have an event that occurs in a usercontrol flow up to
the parent. The problem is each one entails a lot of coding for just
one use control. Well, I have many user controls and am looking for a
very simple and universial approach. The problem is: I have a webpage
test.aspx and on it I can load any user control I want based on what
the user selects from a menu. Once the usercontrol is up. I want to
say click Save, do my database updates with the click event. Then
after that I want to load in a new usercontrol from the Main webpage.
Considering the size the application will be when someone clicks a
button, or save, or anything I can load many different user controls.
So is there a simple approach that I could take to call my public
LoadNewUserControl(usercontrolfile) method I have in the parent class?

I've seen people do something like this in the Button Click event
inside the user control, but it didn't work for me. The test class
doesn't exist or isn't a type that I can cast too.

Page aPage = (test) this.Parent;
aPage.LoadNewUserControl(test5.ascx);

Nor does this work:

this.Parent as test;

Anyways, Please a few recommendations on how to approach this.

Thanks,

David

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to fire both event button click and textchanged when button is click and text is changed Amy ASP .Net 0 06-01-2006 02:33 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57