Author: hkbeer | Posted on: 11/15/2010 5:20:19 AM | Views : 865

I have a Formview InsertTemplate a dropdownlist with datasource1 and I want onclick of an imagecontrol the dropdownlist will display another set of data from datasource2 instead. My code is as follows but with error onclick. Pls help how to modify. Thanks
 
Protected Sub ImageOnClick1(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
        Dim dropdownlist1 As DropDownList = CType(FormView1.FindControl("dropdownlist1"), DropDownList)
        dropdownlist1.DataSourceID = "AltDept"
        dropdownlist1.DataBind()
    End Sub
The following is in InsertTemplate of Formview
<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="BarButton/add.jpg" OnClick="ImageOnClick1" />
  &n ...

Go to the complete details ...