Om my Custom List.aspx Page , i tried to write code in the OnFilterSelectedIndexChanged event which is supposed to fire from the dynamicfilter
OnSelectedIndexChanged.
Then i noticed that the event was not fired. Looking in the Filterusercontrol.ascx.vb (i am using vb) i found only the following line regarding the event.
Public
Custom
Event SelectedIndexChanged
As EventHandler
Which i changed to this ...
Public
Custom
Event SelectedIndexChanged
As EventHandler
AddHandler(ByVal value
As EventHandler)
AddHandler DropDownList1.SelectedIndexChanged, value
End
AddHandler
RemoveHandler(ByVal value
As EventHandler)
RemoveHandler DropDownList1.SelectedIndexChanged, value
End
RemoveHandler
RaiseEvent(ByVal sender
As System.Object,
ByVal e
As System.EventArgs)
End
RaiseEvent
End
Event
Now the event fires but the eventArgs returns Empty ... Any idea ?
You are quite right, the VB version of this file is broken, and your fix is correct. We're using a translator to convert from C# to VB, and apparently it doesn't do the right thing with events. We'll get a bug filed so we can address in the future.
Now the event fires but the eventArgs returns Empty ... Any idea ?
I know this is way late, but to follow up on the issue that the eventArgs return Empty: This is happening because essentially the way the implementation works is by forwarding the events fired from the underlying UI control (like the DropDownList declared
in FilterUserControl) to the page that loads it. It is the DropDownList that fires its event using EventArgs.Empty and so that's why your event handler is getting them as empty. You should instead cast the sender and then inspect the relevant values to determine
what the new state is.
Member
1 Points
10 Posts
FilterUserControl
Oct 27, 2008 07:15 PM|flougr|LINK
Om my Custom List.aspx Page , i tried to write code in the OnFilterSelectedIndexChanged event which is supposed to fire from the dynamicfilter OnSelectedIndexChanged.
Then i noticed that the event was not fired. Looking in the Filterusercontrol.ascx.vb (i am using vb) i found only the following line regarding the event.
Public Custom Event SelectedIndexChanged As EventHandler
Which i changed to this ...
Public Custom Event SelectedIndexChanged As EventHandler AddHandler(ByVal value As EventHandler) AddHandler DropDownList1.SelectedIndexChanged, value End AddHandler RemoveHandler(ByVal value As EventHandler) RemoveHandler DropDownList1.SelectedIndexChanged, value End RemoveHandler RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) End RaiseEvent End EventNow the event fires but the eventArgs returns Empty ... Any idea ?
Dynamic Data FilteUserControl
Contributor
3384 Points
1363 Posts
Re: FilterUserControl
Oct 27, 2008 09:19 PM|davidebb|LINK
You are quite right, the VB version of this file is broken, and your fix is correct. We're using a translator to convert from C# to VB, and apparently it doesn't do the right thing with events. We'll get a bug filed so we can address in the future.
thanks!
David
Member
1 Points
10 Posts
Re: FilterUserControl
Oct 28, 2008 06:28 AM|flougr|LINK
Ok David
, thanks for the quick verification.
Flougr
Contributor
2127 Points
604 Posts
Microsoft
Re: FilterUserControl
Dec 16, 2008 06:37 PM|marcind|LINK
I know this is way late, but to follow up on the issue that the eventArgs return Empty: This is happening because essentially the way the implementation works is by forwarding the events fired from the underlying UI control (like the DropDownList declared in FilterUserControl) to the page that loads it. It is the DropDownList that fires its event using EventArgs.Empty and so that's why your event handler is getting them as empty. You should instead cast the sender and then inspect the relevant values to determine what the new state is.
ASP.NET Team
@marcind
Blog