Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx @ 6097

Last change on this file since 6097 was 6097, checked in by mjesner, 13 years ago

#1499 query filter

File size: 1.7 KB
Line 
1<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
2<%@ Import Namespace="HLWebOKBQueryPlugin.Models" %>
3<%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %>
4<!-- Put all into a form that calls the "AddFilter" Action-->
5<% using (Html.BeginForm("AddFilter", "Filter")) %>
6<% { %>
7<p>
8    Select Filter:
9    <%: Html.DropDownList("filtersCombobox", new SelectList(((FilterModel)Model).Filters, "FilterTypeName", "Label"))%>
10    <input type="submit" value="add" />
11</p>
12<ul>
13    <!-- Build the selected filters. The filtesr will be stored in the session and the
14Controller puts the current filters from the session into the model. Selected Filters
15will be iterated. -->
16    <% if (((FilterModel)Model).SelectedFilters != null)
17       {
18
19           foreach (Filter f in ((FilterModel)Model).SelectedFilters)
20           { %>
21    <li>
22        <%
23// If type is StringComparisonFilter build thes controls
24if ("StringComparisonFilter".Equals(f.GetType().Name))
25{  %>
26        <%: Html.TextBox("valueTextbox." + f.GetType().Name, ((StringComparisonFilter)f).Value)%>
27        <%: Html.LabelFor(x => f.Label)%>
28        <% }
29               // If type is NameStringComparisonFilter build thes controls
30               else if ("NameStringComparisonFilter".Equals(f.GetType().Name))
31               { %>
32        <%: Html.TextBox("valueTextbox." + f.GetType().Name, ((NameStringComparisonFilter)f).Value)%>
33        <!-- other filter >
34          <% } // If type is StringComparisonFilter build thes controls
35       else
36       { %>
37       <!-- type not supported ... -->
38        FilerTypeName =
39        <%: Html.Label(f.GetType().Name)%>
40        <% }
41        %>
42    </li>
43    <% }
44
45       }
46   }%>
47</ul>
Note: See TracBrowser for help on using the repository browser.