1

In my view I have check box for multiple data source some text boxes and a search button

<table width="100%">
   <tr>
       <td width="12%">
           Data Source
       </td>
       <td>
          @Html.CheckBoxFor(per => per.DataSource1) &nbsp; DataSource1 &nbsp; &nbsp; 
          @Html.CheckBoxFor(per => per.DataSource2) &nbsp; DataSource2 &nbsp; &nbsp;  
          @Html.CheckBoxFor(per => per.DataSource3) &nbsp; DataSource3 &nbsp; &nbsp;         
          @Html.CheckBoxFor(per => per.DataSource4) &nbsp; DataSource4 &nbsp; &nbsp;
          @Html.CheckBoxFor(per => per.DataSource5) &nbsp; DataSource5 &nbsp; &nbsp;
       </td>
        <td>
           First Name
       </td>
       <td>
           @Html.TextBoxFor(per => per.FirstName)
       </td>

        <td>
           Last Name
       </td>
       <td>
           @Html.TextBoxFor(per => per.LastName)
       </td>
       <td>
           <button name="button" value="search" class="button">
                    Search</button>
       </td>
   </tr>

On clicking the search button based on values entered in the text boxes the names are search in the datasources checked. Say if the datasource 1 and 2 are selected the the first and Last Name is searched against DataSource1 and datasource2. The two list of result populate the grid in partial view and displayed twice.

How to achive this. depending on the source selected like say all, 5 grid should be displayed. the datasource can increase in future so i wanted to make something that handles dynamically loading of the grid depening of the number of sources selected

DotNetBeginner
  • 412
  • 2
  • 15
  • 34

0 Answers0