'ObjectDataSource1' could not find a non-generic method 'getCOMDLs' that has parameters:
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 Data开发者_Python百科Field="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
After researching this issue/trial and error, the solution was adding Name="searchParam" to the form parameter control.
精彩评论