Currently trying to fix an ASP.NET web application. Everything works fine, except being able to press the "enter" or "return" key to submit the form, from a Windows Mobile 5.0 device.
Basically, the site has one text box (the search box) and one button that has a PostBackUrl attached to it. Pressing the button works fine, but the device that is being used, mainly, has a big enter key as well as a scanner that uses the "enter" or "return" function. When the "enter" key is pressed down, or a scan is made and "enter" is passed along, it appears to refresh the page but will not submit.
I have tried numerous suggestions such as: defaultbutton attribute, wrapping in a panel and designating defaultbutton, javascript, usesubmitbehavior, and more. I have spent hours on this and haven't gotten anywhere. Your help is greatly appreciated!
I have taken everything back down to the base code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="searchcode.aspx.cs" Inherits="search_inventory_control_searchcode" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
text-align: center;
}
</style>
</head>
<body>
<form id="form1" runat="server" defaultfocus="CodeSearchBox" defaultbutton="SearchButton">
<div class="auto-style1">
<a href="index.aspx">
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/logo.png" />
</a>
</div>
<p class="auto-style1">
<strong>Search Inventory by Product Code</strong></p>
<p class="auto-style1">
<asp:TextBox ID="CodeSearchBox" runat="server" Width="180px"></asp:TextBox>
</p>
<p class="auto-style1">
<asp:Button ID="SearchButton" runat="server" Text="Search" Width="180px" Height="30px" PostBackUrl="~/search/inventory_control/resultscode.aspx" />
</p>
</div>
</form>
</body>
</html>