Warning: Constant ABSPATH already defined in /var/www/html/site/wp-config.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/site/wp-config.php:34) in /var/www/html/site/wp-content/plugins/comet-cache/src/includes/traits/Shared/HttpUtils.php on line 172

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/site/wp-config.php:34) in /var/www/html/site/wp-content/plugins/comet-cache/src/includes/traits/Shared/HttpUtils.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/site/wp-config.php:34) in /var/www/html/site/wp-content/plugins/comet-cache/src/includes/traits/Shared/HttpUtils.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/site/wp-config.php:34) in /var/www/html/site/wp-content/plugins/comet-cache/src/includes/traits/Shared/HttpUtils.php on line 175

Warning: Constant WP_DEBUG already defined in /var/www/html/site/wp-config.php on line 39

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/site/wp-config.php:34) in /var/www/html/site/wp-includes/feed-rss2-comments.php on line 8
Comments on: ASP.NET Dynamic Data – Text filter / Search https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/ www.appmire.be Sat, 27 Apr 2013 09:33:00 +0000 hourly 1 By: Lucio Fassio https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-313 Fri, 23 Mar 2012 18:39:12 +0000 http://www.trappers.tk/site/?p=262#comment-313 Great ! added search like a breeze, thank you for posting

]]>
By: Esben https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-202 Fri, 05 Aug 2011 09:02:57 +0000 http://www.trappers.tk/site/?p=262#comment-202 Thank you very much for this post! Helped me a lot!! 🙂

]]>
By: Jeroen Trappers https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-201 Mon, 01 Aug 2011 12:45:08 +0000 http://www.trappers.tk/site/?p=262#comment-201 In reply to Alexander.

Try running the full example, for which I include the source code. If you still have problems, I can’t help you without seeing your code.

]]>
By: Alexander https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-199 Mon, 25 Jul 2011 13:57:57 +0000 http://www.trappers.tk/site/?p=262#comment-199 Hi Jeroen,

I do not work .. Followed step by step the tutorial but the only thing I see is the “Search” button. I do not see the TextBox (TextFilter.ascx).

Help me? Thanks!

]]>
By: jeroen.trappers https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-133 Wed, 30 Mar 2011 19:12:04 +0000 http://www.trappers.tk/site/?p=262#comment-133 Hi Riper,

Make sure that you apply the FilterUIHint attribute on the right property, and that the class that contains the property is \glued\ to the generated partial class with the MetadataType attribute, like in the example. Also make sure that you have the ascx and code behind file for the user control in the right location, namely Filter.

You can download Northwind for free, link is in the post. Easy to setup, just copy and paste the Northwind.mdf and .ldf file in the App_Data folder, double click and there you go.

Good luck, let me know if you have trouble getting it going.

]]>
By: riper https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-128 Tue, 29 Mar 2011 16:15:12 +0000 http://www.trappers.tk/site/?p=262#comment-128 I’ve tried adding this to my dynamic data web site but the controls don’t show up. Should
[FilterUIHint(“TextFilter”)]
public string Description { get; set; }
be enough to make it show the TextFilter’s dropdownlist and textbox? I feel there is a lot of magic going on here, please help me! 🙂

ps. I haven’t tried with your project since I don’t have the NorthWind Database.

Thanks for a great initiative!

]]>
By: Steve https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-120 Mon, 21 Mar 2011 03:36:46 +0000 http://www.trappers.tk/site/?p=262#comment-120 Thanks Jeroen again for your kindly help.

The uppercase search is working now by using
var upperProperty = Expression.Call(property, typeof(String).GetMethod(“ToUpper”, new Type[] { }));

The google search rank of this post has become higher now. Great!
EDIT: –> I remove your urls, as they are not pointing to anything relevant. I see this as spam, so please don’t do it.

]]>
By: Jeroen Trappers https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-119 Fri, 18 Mar 2011 21:12:14 +0000 http://www.trappers.tk/site/?p=262#comment-119 Hi Steve,
You shouldn’t try to do the 3rd approach. Just convert the input value of the textbox toUpper before creating the expression. It doesn’t need to be part of the expression that you hand to Linq2Entities. (I tried it, and it is not supported by Linq2Entities)

So change this line of code in the filter control (code behind):

string filterValue = this.textBox.Text;

To this:
string filterValue = this.TextBox.Text.ToUpper();

the rest is the same as the original implementation. You need to make sure that you apply the search field to a column that has been “pre-calculated” in the database to be all Uppercase. You could use ToUpperInvariant() as well.

If you would like to try the ToUpper combined with Contains: this is the expression to do that:

case “contains”:
var upperProperty = Expression.Call(property, typeof(string).GetMethod(“ToUpperInvariant”));

comparison = Expression.Call(upperProperty, typeof(string).GetMethod(“Contains”, new Type[] { typeof(string) }), value);

break;

Hope this helps

]]>
By: Steve https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-118 Thu, 17 Mar 2011 12:12:19 +0000 http://www.trappers.tk/site/?p=262#comment-118 Thanks Jeroen for the 3 approach
Approach 1: i can’t work this out as LINQ2Entities not support for “IndexOf ” overloading
Approach 2: still got case sensitive result
Approach 3: how can i include both GetMethod “toUpper” and “Contains” in the same Expression.Call statement ?

Sorry for my newbie questions Thanks again for your guidance.

FYR. I have also tried using db features such as NLS_COMP and NLS_ORDER [_CI] but I’m using Oracle9i and I can only make it case-insensitive match on ‘=’ operator but not ‘like’ operator
so i need to do it on the coding level …..
http://www.orafaq.com/node/999
Setting NLS_COMP to ANSI causes Oracle9i to use the sort order specified in NLS_SORT when doing an ORDER BY. But one big limitation is that when NLS_COMP is set to ANSI, only certain SQL functions and operations will use the NLS_SORT sort order. The rest will still use the default BINARY sort order. For example, the = (equality) operator will do a case-insensitive comparison, but the “like” operator will not:

]]>
By: Jeroen Trappers https://jeroentrappers.hetz1.appmire.be/2011/03/01/asp-net-dynamic-data-text-filter-search/#comment-115 Wed, 16 Mar 2011 20:35:58 +0000 http://www.trappers.tk/site/?p=262#comment-115 Note that another option is to have a “UPPERCASE” version of the field you want to search on in the database, do the search term to uppercase, and compare to that field in the database. This is probably the best way to do it, if you’re having issues getting it to work. The down-side is, that it takes some space on the database.

]]>