[thelist] (asp.net) Custom Events on user controls?

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Fri Feb 17 21:39:02 CST 2006


Nope.  That's basically the other side of the same coin (public properties, public methods).  Sounds like a winner to me.

 From: "Tab Alleman" talleman at Lumpsum.com

I do want to specify which event triggers the postback... I suppose I could check the request.params. A co-worker just suggested putting a method in my control, and calling that method in the Submit_Click event on the containing page. It sounds pretty reasonable to me, but maybe there's a gotcha waiting around that corner...?

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
On Behalf Of Peter Brunone (EasyListBox.com)
> 
> Couldn't you just check Page.IsPostBack from the user 
> control? Or are you looking for a specific event that 
> triggered postback?
> 
> Another approach would be to create public properties on the 
> UC that map to the form fields in question; you could then 
> read these properties from the containing page. 
> 
> HTH,
> 
> Peter
> 
> From: "Tab Alleman" talleman at Lumpsum.com
> 
> I've created a user control that has some form fields on it, 
> however, it doesn't have a submit button. The submit button 
> is on the outer page that contains the user control.
> 
> Is there a standard way to have the outer page fire a 
> subroutine in the user control so that when the submit button 
> is clicked, the user control is aware of it and saves the 
> data in its form fields?



More information about the thelist mailing list