Friday, May 28, 2010

My 5 Month Old Has A Dry Cough

is not allowed HTTP POST verb accessing an html page

This error can result for several reasons, but I'm focus when trying to access generates an HTML page using the property PostBackUrl a control button, ImageButton, or LinkButton in ASP.NET.

Normally the aim is to go from one page to another by pressing a button. Putting on the property control PostBackUrl the name of the landing page works, except that set the target to an html page instead of aspx.

This has to do with cross-page posting. NET (which allows access from one page to the controls on the source page.) Html pages can not process a form submitted with HTTP post and when we produce a postback (server request) default form is sent to landing page.

There are several ways to solve this problem
  1. Change the button for a hyperlink to the destination (which may cause the page layout change too much)
  2. Set the button's click event indicating Response.Redirect , the landing page and remove the value of the property PostBackUrl
In the case of an HTML button (input type = "button") can schedule the event onclic with javascript on the client

In the case of a asp.net button control of the programming we do in the code file
Some links to learn more about this topic:

0 comments:

Post a Comment