views:

15

answers:

1

Getting this error message and I am not able to figure out why. Here is my code:

<asp:TextBox ID="searchParam" Width="250px" runat="server"></asp:TextBox><asp:button ID="btnSearch" runat="server" Text="Search" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="getCOMDLs" TypeName="NewEmployee">
    <SelectParameters>
        <asp:FormParameter FormField="searchParam" Type="String" DefaultValue="" />
    </SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="dgSearchDLs" runat="server" DataKeyNames="cn" AllowPaging="false" DataSourceID="ObjectDataSource1">
    <Columns>
        <asp:BoundField DataField="cn" HeaderText="DL Name"/>
        <asp:BoundField DataField="managedBy" HeaderText="Managed By"/>
        <asp:BoundField DataField="info" HeaderText="Notes"/>
        <asp:ButtonField ButtonType="Button" text="Add" HeaderText = "Select DL" CommandName="AddDL"  />
    </Columns>
</asp:GridView>

NewEmployee Class:

Function getCOMDLs(ByVal searchParam As String) As DataTable
    ...
End Function
A: 

After researching this issue/trial and error, the solution was adding Name="searchParam" to the form parameter control.

mjw06d