473,396 Members | 2,106 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,396 software developers and data experts.

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

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

Aug 30 '06 #1
0 1198

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jw56578 | last post by:
Hi, How would the following be accomplished. I have a parent aspx page, that dynamically loads 3 user controls (through LoadControl) depending on a certain criteria. I want the click of a button...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
1
by: jelle.huygen | last post by:
Hello, I have a problem in ASP.NET 2.0 with the viewstate of my dynamically added user control. I have reproduced the problem with a very simple user control and a very simple page. On my...
2
by: ami | last post by:
In my code, I need to implement x numbers of Gridviews dynamically based on user selection. Because I am unaware of the number of gridviews, this is done after the user enters input. I need to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.