Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2045
WebDropDown AutoPostBack Null error
posted

I have WebDropDown control that shows images and text. Works fine if AutoPosttBack=false. If I enabled Postback and select item I got System.NullReferenceException error on <img source line in ASPX.

Here is my code:

    <ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px"
        DataSourceID="ObjectDataSource1" TextField="groupname" ValueField="groupid"
           CurrentValue="Add Permission To Group/User" AutoPostBack="True" >
            <DropDownItemBinding TextField="groupname" ValueField="groupid"></DropDownItemBinding>
           <ItemTemplate>
                <img src='<%# Eval("id").ToString()=="1" ? "../images/group.png" : "../images/user.png" %>' alt="" width="16" height="16" />
                <%# DataBinder.Eval(Container.DataItem, "groupname")%>
               </ItemTemplate>
    </ig:WebDropDown>