W3C validation for server side form tag

I checked my html site check in w3.org and got this error

Bad value for attribute action in element form: must be nonempty.

but my form is an asp.net server form, and I cannot set the action attribute.

How can I solve this error?

+8
html w3c-validation
source share
3 answers

This is an old post, but for future reference in ASP.NET you can avoid the following errors:

<form action="#" runat="server"> 

This will be verified using the W3C and does not require special coding to detect the URL of the page where you are currently located.

+11
source share
 form1.Action = Request.Url.AbsoluteUri; 

it works for me

+7
source share

Omit the action attribute. According to the draft HTML5, this is not required, but if present, its value must be non-empty. Link: WHATWG HTML5 draft, description of the action attribute .

+2
source share

All Articles