I want to use post to upload the value of a page form to another page. When I click default. when the send and submit button of aspx is used, the default2.aspx page is displayed. At this time, an error is reported, and the error message is validation of viewstate Mac failed. if this application is hosted by a Web farm or cluster, ensure that <machinekey> Configuration specifies the same validationkey and validation algorithm. autogenerate cannot be used in a cluster (I don't understand why it is like this !)
Solution: Add <% @ page Language = "C #" enableviewstatemac = "false" %> to default2.aspx on the page to be accepted!
Default. aspx pageCode:
<Form ID = "form1" method = "Post" Action = "default2.aspx" runat = "server"> <div> your name <asp: textbox id = "name" runat = "server"> </ASP: textbox> <br/> <input type = "Submit" value = "send"/> <br/> learn how to use request and response <br /> <br/> </div> </form>
Default2.aspx Page code:
String Name = Request [ " Name " ];
Response. Write (name + " <Br> " );
Response. Write ( " You are using " + Request. requesttype + " Transmission data " );
Only code for accepting Form values is added to page_load!