Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs	(revision 6097)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs	(revision 6097)
@@ -0,0 +1,126 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using HLWebOKBQueryPlugin.Models;
+using HLWebOKBQueryPlugin.Helpers;
+using HLWebOKBQueryPlugin.OKBQueryService;
+
+namespace HLWebOKBQueryPlugin.Controllers
+{
+    /// <summary>
+    /// Controller for the filter subpage.
+    /// </summary>
+    public class FilterController : Controller
+    {
+        //
+        // GET: /Filter/
+
+
+        [ChildActionOnly]
+        public ActionResult Filters()
+        {
+            // For ModelViewuUserControl
+            return PartialView("Filters"); // name of usercontrol
+        }
+
+
+        /// <summary>
+        /// This action will be called from the Filters.ascx
+        /// when submitting the form.
+        /// </summary>
+        /// <param name="collection"></param>
+        /// <returns></returns>
+        public ActionResult AddFilter(FormCollection collection)
+        {
+            // Model     
+            FilterModel qm = new FilterModel();
+
+            // Get filters from service and set the model
+            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
+            List<Filter> filterList = client.GetFilters().ToList();
+            qm.Filters = filterList;
+
+
+            // Selected filter (from combobox)
+            string filterType = collection.Get("filtersCombobox");
+            Filter filter = filterList.Where(x => x.FilterTypeName.Equals(filterType)).First();
+
+
+            // Get selected filters form session
+            qm.SelectedFilters = (List<Filter>)Session["selectedFilters"];
+
+            // Add Filter only if not exists
+            if (qm.SelectedFilters.Where(x => x.FilterTypeName.Equals(filter.FilterTypeName)).Count() == 0)
+            {
+
+                qm.SelectedFilters.Add(filter);
+            }
+
+            // Set values for the selected filters
+            foreach (string s in collection.AllKeys)
+            {
+                if (s.StartsWith("valueTextbox"))
+                {
+                    // Get the type of the textbox
+                    string type = s.Substring(s.IndexOf(".") + 1);
+
+                    // Get the filter from the selected filters to set the value(s)
+                    Filter f = qm.SelectedFilters.Where(x => x.GetType().Name.Equals(type)).First();
+                    if ("StringComparisonFilter".Equals(type))
+                    {
+                        ((StringComparisonFilter)f).Value = collection.Get(s);
+                    }
+                    else if ("NameStringComparisonFilter".Equals(type))
+                    {
+                        ((NameStringComparisonFilter)f).Value = collection.Get(s);
+                    }
+                    // TODO: add for all filter types and will the values (etc.)
+                }
+            }
+
+
+
+            // Set session variable with actual selected filters
+            Session["selectedFilters"] = qm.SelectedFilters;
+
+            // "Index" ist the view name. We use here the Index view
+            // because the index view renders the Filters() action 
+            // that will return to the "Filters.ascx" partial view.
+            return View("Index", qm);
+        }
+
+
+        /// <summary>
+        /// This action will be called when rendering
+        /// the index.aspx. This will hapen the first
+        /// time, so the available Filters in the Model
+        /// will be set.
+        /// </summary>
+        /// <returns></returns>
+        public ActionResult Index()
+        {
+            // Set submenu
+            Session["SelectedSubMenu"] = "Filter";
+
+            // Init session variable for selected filters
+            if (Session["selectedFilters"] == null)
+            {
+                Session["selectedFilters"] = new List<Filter>();
+            }
+
+            // Get available filters from service
+            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
+            List<Filter> filterList = client.GetFilters().ToList();
+
+            // Set model
+            FilterModel qm = new FilterModel();
+            qm.Filters = filterList;
+
+            return View(qm);
+        }
+
+
+    }
+}
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/HLWebOKBQueryPlugin.csproj
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/HLWebOKBQueryPlugin.csproj	(revision 6093)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/HLWebOKBQueryPlugin.csproj	(revision 6097)
@@ -88,4 +88,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Controllers\FilterController.cs" />
     <Compile Include="Controllers\HomeController.cs" />
     <Compile Include="Controllers\QueryController.cs" />
@@ -96,4 +97,5 @@
     <Compile Include="Helpers\Query.cs" />
     <Compile Include="Models\AccountModels.cs" />
+    <Compile Include="ViewModels\FilterModel.cs" />
     <Compile Include="Models\QueryModel.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -145,7 +147,9 @@
     </None>
     <Content Include="Views\AlgorithmClass\Index.aspx" />
+    <EmbeddedResource Include="Views\Filter\Filters.ascx" />
+    <Content Include="Views\Filter\Index.aspx" />
     <Content Include="Views\Home\About.aspx" />
     <Content Include="Views\Home\Index.aspx" />
-    <Content Include="Views\Query\Filter.aspx" />
+    <EmbeddedResource Include="Views\Shared\FilterControl.ascx" />
     <Content Include="Views\Query\Index.aspx" />
     <EmbeddedResource Include="Views\Query\Menu.ascx" />
@@ -193,5 +197,5 @@
     <Folder Include="App_Data\" />
     <Folder Include="App_LocalResources\" />
-    <Folder Include="ViewModels\" />
+    <Folder Include="Views\Query\Controls\" />
   </ItemGroup>
   <ItemGroup>
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs	(revision 6097)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs	(revision 6097)
@@ -0,0 +1,19 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using HLWebOKBQueryPlugin.OKBQueryService;
+
+namespace HLWebOKBQueryPlugin.Models
+{
+    /// <summary>
+    /// Model for Filter Data.
+    /// Current Filters (selected),
+    /// and available Filters. 
+    /// </summary>
+    public class FilterModel
+    {
+        public List<Filter> Filters { get; set; }
+        public List<Filter> SelectedFilters { get; set; }
+    }
+}
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx	(revision 6097)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx	(revision 6097)
@@ -0,0 +1,47 @@
+﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
+<%@ Import Namespace="HLWebOKBQueryPlugin.Models" %>
+<%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %>
+<!-- Put all into a form that calls the "AddFilter" Action-->
+<% using (Html.BeginForm("AddFilter", "Filter")) %>
+<% { %>
+<p>
+    Select Filter:
+    <%: Html.DropDownList("filtersCombobox", new SelectList(((FilterModel)Model).Filters, "FilterTypeName", "Label"))%>
+    <input type="submit" value="add" />
+</p>
+<ul>
+    <!-- Build the selected filters. The filtesr will be stored in the session and the
+Controller puts the current filters from the session into the model. Selected Filters
+will be iterated. -->
+    <% if (((FilterModel)Model).SelectedFilters != null)
+       {
+
+           foreach (Filter f in ((FilterModel)Model).SelectedFilters)
+           { %>
+    <li>
+        <%
+// If type is StringComparisonFilter build thes controls
+if ("StringComparisonFilter".Equals(f.GetType().Name))
+{  %>
+        <%: Html.TextBox("valueTextbox." + f.GetType().Name, ((StringComparisonFilter)f).Value)%>
+        <%: Html.LabelFor(x => f.Label)%>
+        <% }
+               // If type is NameStringComparisonFilter build thes controls
+               else if ("NameStringComparisonFilter".Equals(f.GetType().Name))
+               { %>
+        <%: Html.TextBox("valueTextbox." + f.GetType().Name, ((NameStringComparisonFilter)f).Value)%>
+        <!-- other filter >
+          <% } // If type is StringComparisonFilter build thes controls
+       else 
+       { %>
+       <!-- type not supported ... -->
+        FilerTypeName =
+        <%: Html.Label(f.GetType().Name)%>
+        <% }
+        %>
+    </li>
+    <% }
+
+       }
+   }%>
+</ul>
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Index.aspx
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Index.aspx	(revision 6097)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Index.aspx	(revision 6097)
@@ -0,0 +1,13 @@
+﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
+
+<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
+    Index
+</asp:Content>
+<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
+    <h2>Filter</h2>
+    <!--
+     This is the "user control" for the filters. This will call the action "AddFilter"
+     in the controller, after the Action "Index" is called (for rendering the page).
+     -->
+    <% Html.RenderPartial("Filters"); %>
+</asp:Content>
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/Menu.ascx
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/Menu.ascx	(revision 6093)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/Menu.ascx	(revision 6097)
@@ -3,5 +3,5 @@
 <ul>
 <li <% if(Session["SelectedSubMenu"] == "Filter") {%> class="selected" <%}%>>
-    <%: Html.ActionLink("Filter", "Filter", "Query") %>
+    <%: Html.ActionLink("Filter", "Index", "Filter") %>
 </li>
 <li <% if(Session["SelectedSubMenu"] == "Results") {%> class="selected" <%}%>>
