.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Customising filters in .NET 4

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I have a .NET 3.5 Dynamic Data site that I am now overhauling to make it work under .NET 4.  I have managed most of it now (painfully!) but am struggling to get my old custom filters to work.

Under .NET 3.5, the default filter mark-up looked like this:

<asp:FilterRepeater ID="FilterRepeater" runat="server">
        <asp:Label runat="server" Text='<%# Eval("DisplayName") %>' AssociatedControlID="DynamicFilter$DropDownList1" />
        <asp:DynamicFilter runat="server" ID="DynamicFilter" OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />
    <FooterTemplate><br /><br /></FooterTemplate>
This code shows all possible filters above the table; i.e., every column in the table containing a foreign key to another table.  I didn't want to see them all, just the one I was interested in, so previously I had this mark-up in my ListDetails.aspx file:

<asp:Label runat="server" Text="Panel" AssociatedControlID="DynamicFilterPanel$DropDownList1" style="padding-left: 20px;" />
<asp:DynamicFilter runat="server" ID="

View Complete Post

More Related Resource Links

jQuery 1.4 Opacity and IE Filters

client side jQuery library after switching to jQuery 1.4. I ran into a problem with a shadow plugin that I use to provide drop shadows for absolute elements - for Mozilla WebKit browsers the -moz-box-shadow and -webkit-box-shadow CSS attributes are used but for IE

Customizing the UI around the Filters


I have started working on a new project and thought it would be a great idea to dig into the latest version of the Dynamic Data framework that shipped with VS2010.  For the most part, I am impressed, it seems to be pretty easy to extend and create a rich and flexibile UI -- at least that is what I thought until I got to working on a better layout for the filters.

The situation is this:

I have a table with 25 columns and I need to display around 10 different filters (basically and interactive report) -- the filters are of various types.

The problem:

How in the world do I custom the UI layout of the filters.  It seems that with the latest QueryFilterRepeater control we have been left with almost nothing to work with (outside of turning filters on/off and setting the FilterUIHint).  What if I wanted to wrap all of the filters in an expand/collapse region and then inside of that have then sitting in a table of no more than 4 columns (so with 10 filters I wold have 3 rows). 

I have tried extending the QueryFilterRepeater but it seems like there is nothing in that class that we can work with (the data binding events are not even used).

Am I missing something, or am I just out of luck right now?

.NET Matters: Const in C#, Exception Filters, IWin32Window, and More


Welcome to . NET Matters. This new column will delve into the ins and outs of the Microsoft® . NET Framework, answering readers' questions on various topics related to its extensive libraries, languages, and the common language runtime.

Stephen Toub

MSDN Magazine April 2004

ASP.NET: Intercept, Monitor, and Modify Web Requests with HTTP Filters in ISAPI and ASP.NET


There can be many reasons to reroute incoming Web requests. For instance, sometimes it's necessary to redirect a browser to a page based on user criteria without passing long lists of parameters in the URL. In the past, the only way to intercept such page requests and send them elsewhere was with ISAPI. Now, in ASP.NET, the IHttpModule interface provides notification of server requests, and lets you easily reroute them based on criteria other than browser type or version. Here the author demonstrates the use of IHttpModule for interception and explains the use of ISAPI filters for anyone who isn't yet using ASP.NET.

Panos Kougiouris

MSDN Magazine August 2002

ISAPI Filters: Designing SiteSentry, an Anti-Scraping Filter for IIS


The Microsoft Internet API for IIS, ISAPI, sits between the client and the Web server. Therefore, you can access the HTTP data stream before IIS gets to see it. The project in this article takes advantage of the ISAPI architecture to create a filter that monitors access to a Web site to determine if visits are from typical users or from automated processes designed to pilfer information from your site. The author tracks the regularity of visits to the site to determine the likely source. Once the determination is made, the app either redirects the user or continues to track information about those hits.

Rodney Bennett

MSDN Magazine October 2001

Will MVC3 make possible to use IOC with Action Filters



Will MVC3 make possible to use IOC with Action Filters?

Is this on the roadmap?



Unable to use filters


I get the following error in the event viewer when trying to use filters. Isn't this the way the query should be written.

Please note that my database is oracle and Badge Number field is actually a character field

When i am not using the filter, I can properly retrieve all rows in the view without any error.

Could not run query/stored proceedure 'Select "BADGE_NO","EMPLOYEE","DOCUMENT","ISSUE_DT","EXPIRY_DT" from PAY.GNET_EMP_DOC_EXPIRY WHERE BADGE_NO=:BADGE_NO' using 'Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=;Integrated Security=False;User ID=pay;Enlist=True;Pooling=True;Min Pool Size=0;Max Pool Size=100;Unicode=False;Load Balance Timeout=0;Omit Oracle Connection Name=False;Persist Security Info=false;' in App Domain '/LM/W3SVC/1595713455/ROOT-1-129266459899937441'. The full exception text is: ORA-01036: illegal variable name/number

Could anyone shed light on this. I am awfully stuck

Dynamic Data Entity Framework Filters



I'm working on EF DynamicData project (for .NET 3.5) and I didn't manage to find any code or examples for filters like in Dynamic Data Filtering (http://dynamicdatafiltering.codeplex.com/) or Dynamic Data Futures that support Entity Framework (the versions are for Linq2SQL only). 

The primary functionality that i want implement is having dynamic textboxes for searching datagrid based on the filterAttribute. Can You help me with an idea or some guideliness how to implement it or make modifications on something existing?

3 Cascading Filters

Hello ThereI have the following tables, country,state, city and companycompany belongs to city, city to state and state to country.I am developing the Company Screen with Dynamic Data. It has an idCity field.but I dont know how to make  that when users create a new row on the company table, or edit a new  one. It should show the 3 filtersCountry, State and City.Can somebody help me, I used dynamic data about 1.5 years ago and I dont remember a lot of things

Filters Latest Versions?

I created a dynamic data site with asp.net 3.5 and I see it doesnt have the filter folder yet, so which are the latest version and blog post with instructions in how to install the filters part.?I saw this but this is from 2008http://csharpbits.notaclue.net/2008/09/dynamic-data-futures-advanced-filters.htmlThx

PerformancePoint filters arranging months out of order

I have a pretty simple analytic chart on my sharepoint site. The columns are The name of the location, and the month, and then all of the data is in the rows.   so basically it looks like this                   Place 1                                  Place 2           jan feb mar april may june             jan feb mar april may june row1 row2 row3   You get the point. The problem is, I want to have two filters; one that filters by the locations, and one that filters by the months. When I created the locations filter and connected it to the grid, it made all of the months go in alphabetical order instead of the correct order, like so:                 place 1          aug dec jul nov oct row1 row2 Obviously, this is not how a calendar is supposed to look. I already changed the properties in my sql cube to make the months go in the correct order in the unfiltered chart. They are ordered by the key, which is mont

Central Administration Could not retrieve ISAPI filters

I am having trouble with CA. When I try to open it errors pops up in event viewer  - Could not load all ISAPI filters for site 'SHAREPOINT CENTRAL ADMINISTRATION V3'.  Therefore site startup aborted. - The update cannot be started because the content sources cannot be accessed. Fix the errors and try the update again. Context: Application 'Search', Catalog 'index file on the search server Search' SO I wanted to add those filters and I went to ISAPI filters of CA but whe I try to open ISAPI , I receive following error  Filename \\?\C:\Windows\System32\inetsrv\config\applicationHost.config , line number 3155 Cannot add duplicate collection entry of type 'filter' with unique key attribute 'name' set to 'ASP.Net_2.0.50727'  Config Source:  <isapiFilters>                 <filter name="ASP.NET_2.0.50727.0"  path="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll"  enableCache="true" preCondition="bitness32"/> <filter name="ASP.NET_2.0.50727.0"  path="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll"  enableCache="true" preCondition="bitness64"/>             </isapiFilters>

Issue with transactional replication on SQL 2005 SP3 using row filters with bit columns

We recently upgraded from SQL 2000 to SQL 2005 SP3 and I am noticing something that I think is a bug with replication from a publication that has an article in it with row filters.  It seems to be that if the row filter has columns that are bit datatype and that column is updated on the publisher to cause the row filter to exclude it, it is not removed from the subscriber.  If you update a column that is part of the row filter that is not a bit datatype it works as expected.  I can reproduce this in a test environment with a small base table.  In production this is resulting in an occasional 20598 error "The row was not found at the Subscriber when applying the replicated command". Is anyone aware of a hotfix that addresses this? I can think of a few work arounds but the table is rather large and I really would like to avoid having to pull replication, re-snap or changing datatypes on the base table etc. Any suggestions are greatly appreciated.  Thanks!

Dynamic member selection filters in Dashboard Designer/PPS2010

Question regarding member selection filters in Dashboard Designer (PPS 2010): When selecting the filter members, is there any way to make them dynamic? I.e. when a new member is added (e.g. a new year when we enter one), can it be included without having to manually add them in the filter? Thanks.

DynamicData Filters but with Stored Procedures.

Wow, this is hard to belive that I havent been able to find a good example about this.I have a table, Companies, with many fields including City.A SP with parameter idCity to get companies.I am using dynamic data and I got thisSnippet       [Filter(Enabled = true)]      public object Ciudad { get; set; }However I have no idea how to pass to the stored procedure this parameter.pls help

Can I make member selection filters dynamic?

Question regarding member selection filters in Dashboard Designer (PPS 2010): When selecting the filter members, is there any way to make them dynamic? I.e. when a new member is added (e.g. a new year when we enter one), can it be included without having to manually add them in the filter? Thanks.

Load balancing and Custom Filters in WCF 4.0 Routing Services

Hi, Couild someone please guide me to various ways of achieving load balancing using Router Service. i tried seeing few Blogs and tried to understand the round robin concept and the custom filters conceptr. but i m not able to see any specific site which would guide me on various examples of custom filters .And round robin seems a bit complex. http://blogs.msdn.com/b/routingrules/archive/2010/04/14/load-balancing-at-the-routing-service.aspx The above link gave me some insight  . is there any othe way of achieving load balancing other than Round robin. I did go through the samples of Routing services in WCf training Kit Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend