Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1026997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:10:15+00:00 2026-05-16T12:10:15+00:00

I have a ListView on a page that uses a object data source. I

  • 0

I have a ListView on a page that uses a object data source. I want to be able to add a search box to the page and only show the results that match the search query. Does anyone have a good reference? I’m using C#.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="system.aspx.cs" Inherits="system" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:Label ID="LabelSearch" runat="server" Text="Search: " />
    <asp:TextBox ID="TextSearchBox" runat="server" />
    <asp:ImageButton ID="ButtonSearchBox" runat="server" ImageUrl="~/Styles/Images/Find.png"
        OnClick="ButtonSearchBox_Click" />&nbsp;
    <asp:Label ID="LabelSystemCount" runat="server" />
    <asp:ListView ID="SystemList" runat="server" DataSourceID="SystemSource" DataKeyNames="SystemID">
        <ItemTemplate>
            <tr id="row" runat="server" class='<%# Container.DataItemIndex % 2 == 0 ? "row" : "altrow" %>'>
                <td>
                    <%# Eval("Name") %>
                </td>
                <td>
                    <%# Eval("Acronym") %>
                </td>
                <td>
                    <%# Eval("Description") %>
                </td>
                <td>
                    <asp:ImageButton ID="ButtonEdit" runat="server" ImageUrl="~/Styles/Images/Edit.png"
                        ToolTip="Edit" OnClick="ButtonEdit_Click" />
                    <asp:ImageButton ID="ButtonDelete" runat="server" ImageUrl="~/Styles/Images/Delete-Red-Cross.png"
                        ToolTip="Delete" CommandName="Delete" />
                </td>
            </tr>
        </ItemTemplate>
        <LayoutTemplate>
            <table class="system">
                <tr>
                    <th>
                        <asp:LinkButton runat="server" Text="System Name" />
                    </th>
                    <th>
                        <asp:LinkButton runat="server" Text="Acronym" />
                    </th>
                    <th>
                        <asp:LinkButton runat="server" Text="Description" />
                    </th>
                    <th>
                        <asp:Label runat="server" Text="" />
                    </th>
                </tr>
                <tr id="itemPlaceholder" runat="server" />
            </table>
        </LayoutTemplate>
    </asp:ListView>
    <asp:DataPager ID="SystemPager" runat="server" PageSize="10" PagedControlID="SystemList">
        <Fields>
            <asp:NumericPagerField />
        </Fields>
    </asp:DataPager>
    <asp:ObjectDataSource ID="SystemSource" runat="server" DataObjectTypeName="cipfinModel.System"
        DeleteMethod="Delete" SelectMethod="GetSystems" SelectCountMethod="SystemCount"
        TypeName="SystemDAO" InsertMethod="Insert" UpdateMethod="Update" EnablePaging="true" />
</asp:Content>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:10:16+00:00Added an answer on May 16, 2026 at 12:10 pm

    Change your GetSystems method to

    GetSystems(String filterword)
    

    and provide the text entered into the textbox to the parameter of your ObjectdataSource Select method.

    Steps:
    1) Change your method in the business class.
    2) Rebuild the project and all neccessary libraries
    3) Go to the designer and let it refresh the Select Method of your ObjectDataSource. Select as Parametersource None and leave the Defaultvalue blank.
    4) Open the EventHandler of the ButtonClick. (Adapt to your actual coding:)

    this.SystemSource.SelectParameters["PARAMETERNAME"].DefaultValue = TextSearchBox.Text;
    this.SystemSource.Databind();
    this.SystemList.DataBind();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ListView that uses a GridView to display several columns of data. Two
I have a listview that contains values from webservice.Each page contains only 10 listitems
I have a listview in my jQuery page and I dynamically add content to
In my asp.net page I have a listview that has a datapager defined in
I have a listview on my page that can display 10,000 or more rows.
I have a ListView on a page that displays a list of widgets. When
I have a shopping cart ListView control backed by a custom object that has
I have a ViewPager that uses ListFragments on each page. I implement onListItemClick and
I have a Listview that pulls and displays some data. Field 1 is the
I have a ListView on my checkout page with an ItemTemplate which build up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.