Re: Passing query string param to filter expression on ObjectDataSource

2014-09-01 Thread Prashanth Thiyagalingam
If you are using OOTB search web part then you can do this in client side, get the query string in js and then do a redirection to the target page with the query string value Cheers, Prashanth Sent from my iPhone On Sep 1, 2014, at 1:58 PM, Paul Noone p.no...@keller.com.au wrote: Hi all,

RE: Passing query string param to filter expression on ObjectDataSource

2014-09-01 Thread Paul Noone
Hi Prashanth, Redirecting to the target page and appending the query is no problem. However the Staff Lookup web part on the target page is a custom part. I want to perform a search on page load if the key/value is present and then clear it on postback. Hope that makes sense. Regards, Paul

RE: Passing query string param to filter expression on ObjectDataSource

2014-09-01 Thread James Boman
Paul, HttpContext.Current.Request.QueryString.Clear(); This will clear the querystring on the request object that is about to be destroyed, so is probably not going to be a strategy that will work. You might want to look into modifying the response object, but probably more likely to succeed

RE: Passing query string param to filter expression on ObjectDataSource

2014-09-01 Thread Paul Noone
That makes sense. I initially had it redirecting. Would it be just as good to add the query string check into the click handler for the Search button? if (!String.IsNullOrEmpty(queryString)) { Button1.PostBackUrl = queryString; } And would Request.QueryString.Remove(k) be just as effective?

RE: Passing query string param to filter expression on ObjectDataSource

2014-09-01 Thread James Boman
Paul I think the click handler would be too late. I think you want to do it in the initial pre-render The life cycle would then be: 1. User clicks search in search webpart, cause navigation to URL with k in query string 2. Your onload/prerender runs, receives the k param,

RE: Passing query string param to filter expression on ObjectDataSource

2014-09-01 Thread Paul Noone
Yes, of course. OnPreRender lets me modify the controls after CreateChildControls. Thanks. Not worried about the user seeing it at all. Just wanting to remove it after the query has it. So I now have the following and it’s working like a charm. Thanks, James! protected override void