views:

34

answers:

1

How can i avoid navigation when a user presses the enter key on an asp.net page ? Seems that they get redirected to the first page in the directory structure "Account\AccountRcovery"

I don't actually have any code to redirect to that page. Also can this be disabled for the entire site ? as i have quite a few pages that would require modifications otherwise.

Edit: This seems to only affect IE ,doesn't happens in Firefox.

This is the content for an empty page, where this thing still hapens.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Wip.test" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>
A: 

The problem was a button in the masterpage. When the user pressed enter on a apparently empty form that button was submitting the form and redirecting to AccountRecovery.

Iulian