Ok, so - I think I might have a solution, but I need your help.
If I have a text box and button setup, is it possible to use an asp:repeater control to display the search results?
If so, how would I go about populating it from the text box using a stored procedure in my sql data source?
(Keep in mind that I don't know C#.)
This is how I was thinking I would do it - so far.... please let me know if you think it's a bad idea.... or more complicated than what I'm thinking... as I'm sure someone will.
Code:
<asp:RepeaterID="rpt1"runat="server"DataSourceID="SqlDataSource1">
<HeaderTemplate>
<ahref="<%# DataBinder.Eval(Container.DataItem, "headers") %>"style="color:#9e6917;">
<%# DataBinder.Eval(Container.DataItem, "Name") %></a><br/>
</HeaderTemplate>
<ItemTemplate>
<ahref="<%# DataBinder.Eval(Container.DataItem, "descriptions") %>"style="color:#000000;">
<%# DataBinder.Eval(Container.DataItem, "Name") %></a><br/>
</ItemTemplate>
<FooterTemplate>
<ahref="<%# DataBinder.Eval(Container.DataItem, "urls") %>"style="color:#00508e;">
<%# DataBinder.Eval(Container.DataItem, "Name") %></a><br/>
</FooterTemplate>
</asp:Repeater>
<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:StringName %>"SelectCommand="storedprocedurename"SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameterFormField="txtSearchBar"Name="keyword"Type="String"/>
</SelectParameters>
</asp:SqlDataSource>
From there, I need to get the code to bind the data for when the user clicks the "search button":
Code:
ProtectedSub btnSearch_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles btnSearch.Click
Any ideas?
__________________
Need a vacation.
|