Hi Patrice,
Thanks for the post.
I agree. It should work.
I'm pretty sure I'm missing something somewhere, but can't seem to find
it.
Here's the code as requested.
This is the javascript:
if(window.event.keyCode == 13)
{
var inputs = document.getElementsByTagName("input");
//I could've done a shorter version of this
//But we use a 3rd party cms (sitecore), which handles our layouts
//The cms causes webcontrol ID's to be rewritten to something
//like "uc_search0:btnSearch"
//So I have to search the id for the value "btnSearch"
for(var i = 0; i < inputs.length; i++)
{
if(inputs.item(i).id.toString().indexOf("btnSearch") > -1)
{
inputs.item(i).click();
break;
}
}
}
//----------------------------------------------------------------------------------------------
And the server side code:
private void btnSearch_Click(object sender, System.EventArgs e)
{
string redirectURL = "
http://www.google.com";
//...
//Some basic if statements, which might alter the URL according to
//the search criteria on the form
//...
Response.Redirect(redirectURL);
}
//----------------------------------------------------------------------------------------------
There's nothing funny in the Page_Load either.
I don't know if this behaviour might be caused by the cms. The cms uses
native aspx, so it shouldn't really be the culprit.
I'll do a quick test in plain aspx to see if it is in fact our cms.
Hope its not otherwise I've been wasting your time!
Best,
Andre