Boris,
From your post it looks like your OnCompanyIdEntered method is in the codebehind of your view? If this is the case, then RedirectToAction will not be available to you since that is a Controller method, and not available in a ViewPage. Also, the object collection you're passing into the Html.TextBox function that includes "onkeydown = 'onCompanyIdKeyDown'" actually sets the 'onkeydown' DOM attribute and is not routing to your codebehind like in a Web Forms page.
Instead, you'll be looking to make this a client-side function. Your JavaScript would probably end up looking something like this (if it were inline on the view):
<script type="text/javascript">
function OnCompanyIdEntered() {
if(event.keyCode == 13) //enter key pressed
{
var txtMsg = document.getElementById("txtbox1").value;
if(txtMsg != "")
{
window.location.navigate("<%=Url.Action("Detail") %>?action=" + txtMsg);
}
else
{
event.keyCode =0;
return false;
}
}
return true;
}
</script>
Try adding that and see if it gets you what you want.