Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
User control question
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00696293
Message ID:
00696310
Vues:
10
UserControls have a property called "Page" that is a reference to the page that contains the usercontrol. You could use that property to access the methods contained in the page object. One thing to keep in mind, you need to cast the page to the actual page class you are using like the following:
((MyPage)this.Parent.Page).fnDeleteRecord();
>Hi,
>
>For a new ASP.Net app we're building a number of web forms have the same basic functionality - that is - the ability to Add-Edit-Delete records. That being the case, I'd like to build a user control with the required command buttons that I'd just have to drop onto each web form.
>
>From the user control, I'd like to have it call a 'generic' function on each page. For example, when the Delete commandbutton is clicked, it should call the function 'fnDeleteRecord' on whichever web form is being used. So, my question is how do I tell the user control to call fnDeleteRecord on the web form?
>
>Or, am I way out in left field and is there a better way to do this ...
>
>Thanks, Al
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform