Home > Uncategorized > The HTTP verb POST used to access path […] is not allowed. (ASP.NET)

The HTTP verb POST used to access path […] is not allowed. (ASP.NET)

Hello dear developer who found this page by Google-ing the infamous error message! This error might show up for a number of various reasons. It’s widely discussed on the forums etc and is often over complicated.

Now, if you get this error after clicking on a link button there is a very simple solution to this. Don’t use LinkButton ! Instead grab a HyperLink control from the Toolbox. HyperLink has a property named “NavigateUrl” which can be set from either code behind or in Properties window.

From what I understand the difference between HyperLink and LinkButton (which well explains this error message) is that a LinkButton performs a server PostBack while HyperLink simply redirects you to the URL you set for its NavigateUrl property.

Therefore LinkButtons can’t be directly use to redirect the browser to another directory root. If you haven’t noticed, when you get this error, click on the address bar and hit enter. Yes, it does load your requested page. And that’s because you don’t PostBack this time.

 

However if the LinkButton is not why you get this error, your solution might be a bit tricky and it usually has to do with handler mappings that IIS does. Have a look at the following link for an example:

Luke Melia » ASP.NET – The HTTP verb POST used to access path … is not allowed http://bit.ly/qTLsiQ 

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: