RE: Triggering Events on <asp: RadioButton Help.

From: mojoman896 (mojoman896_at_discussions.microsoft.com)
Date: 07/22/04


Date: Thu, 22 Jul 2004 09:55:03 -0700

Thanks so much for the help, but that didnt fire the event either...

could it be because the RadioControl is embedded in the Datalist? Do i need to get into the bubbling of the events?

This is the last hurdle i need to get really moving on a project, so i appreciate any advice...lete me know if i need to supply more code.

"Steven Cheng[MSFT]" wrote:

> Hi Jason,
>
> From the detailed code you provided, I think the cause of the problem you
> met is that the DataGrid's ItemCreated event handler not be registered
> correctly. In your code, you register the ItemCreated event handler in the
> if(!IsPostBack)
> {
>
> }
> block in the page's Page_Load event, this make the event handler be
> registered only the first time the page is requested and loaded. Then, at
> the sequential request(post back), the event handler is not registered so
> the ItemCreated handler won't be called. You can add a break point in the
> ItemCreated event 's handler and use F5 debug to have a check.
>
> I suggest that you move the following code
> ================
> List_Schedule.ItemCreated += new
> DataListItemEventHandler(this.Item_Created);
> =================
>
> into the OnInit method(or in the InitializeComponent method) of the page
> and don't put it into the
> if(!IsPostBack)
> {
>
> }
>
> block so that register it evetytime the page is request. Thanks.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
>