Advanced Search WebPart

Jul 24, 2008 at 8:06 PM
Having to jump ahead of design discussions ... [sorry]

Try this scenario for answers:

We have built an advanced search page that make some modifications to ESP SearchBox; this is the original CodePlex release.

 

I’ve added my own search button to allow me to marshall values from different controls on the page and format appropriately using SQL. (simple query language)

 

Now we are stumped trying to replicate what we “think” is the postback behavior of the orginal search button. Which is intended to be hidden along with its accompanying text box.

 

Any help on generating a postback from within the page code (default.aspx – ESPSearchBox.cs) would be appreciated.

Any ideas that simplify or complete this need without a postback are also appreciated.


regards
will
Jul 25, 2008 at 2:33 AM
So here is something related:

====
well u can add one hidden Submit button with display style to none to page and then use javascript to call it's click event manually using onclick event of LinkButton
e.g.

<a href=# onclick="javascript:document.getElementById('btnSubmit').click();">Submit</a>
=====

Can I interpret this to mean that the goSearch button in ESPSearchWebParts, which I have only found the .gif for and not the code, will have a click() event on it.....and therefore

if I look through the controls for the SearchBoxEx that ESPSearchBox inherits from, and I can id the control that is the button, (though its type may not be of IButtonControl cuz I think gif's can have embedded actions)  then I could call the event on the control?  Won't this still have the problem of losing track of the http_request from the client?

Can anyone help with this?

Jul 25, 2008 at 3:03 AM
Anyone reading these think this might work?

Build the new query and instead of trying to mimic a postback -

HttpResponse.redirect (newURLwithKqueryargs, bool)

???
Developer
Aug 1, 2008 at 7:06 AM
Hi
Sorry for not responsing earlier but there was holiday time here in Norway :-)

As you noticed the Search box delivered in the ESP Search Web Parts is an extention of the default MS Searh box.
Actually it just hides all the properties which cannot be mapped 1-1 to ESP to not confuse the user.

We did not do anything with the submit part as the same query parameters are used as MS does.
So in short words I don't know the answer to your question myslef. I remember that back then I was looking for this information myself and it was somehow hard to fine.
Or I actually also didn't find an conclusive answer to that.

But in the other hand I think you should be able to do a search box which does not do a postback but a normal request/redirect as you state in your last mail as the esp web parts do not use
the postback at all.
And as long as you don't have any other web parts on the page which need the postback you should be fine.
You could also for example not use a hidden button but just embadd the image into a link and marshall your values and build the request URL by javascript.