mardi 27 août 2019

Web Application Project not accessible due to form tag on every page

I have a legacy Web Application Project (WAP) that I need to ensure is accessible. This type of project has a Master Page (Site.Master) and each page (called a Web Form) inherits from that page to maintain a consistent look.

A fresh Master Page looks like below:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="First5Edmx.Site" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

You will see that the body contains a form tag, which means that every page using Site.Master as it's template will have a form on it, regardless of if it's actually a form. If you remove the form tag the project will not compile.

When I run web accessibility on my site I am getting the error "The page contains a form but there is no submit button" on every page. It is, of course, correct, but how do I make this code accessible (without re-creating the whole project in more modern technology)?




Aucun commentaire:

Enregistrer un commentaire