Sign in | Join
Last post 05-02-2007 1:48 PM by tiagosalgado. 2 replies.
Sort Posts: Oldest to newest Newest to oldest
I everyone,
I need to force a event fire when i set a new selectedvalue. So, i've got this code:
Protected
DropDownList2.SelectedValue =
End
Protected Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList2.SelectedIndexChanged
Response.Write(
This is a sample code. The idea is to fire the SelectedIndexChanged event when SelectedValue is updated.
I'm not sure if you can force the event to fire, but you can call the method directly.
DropDownList2_SelectedIndexChanged(Nothing, Nothing)
You can also add a check to make sure the value actually did change before you call the method.
I've found a way with "Call DropDownList_SelectedIndexChanged(DropDownList2,e)"
Yes, before make the call, i check if the selectedvalue is different... if not, it don't call anything.
Thanks.