<form id="sampleForm" runat="server" action="proc.aspx" method="post">...</form>
티스토리 뷰
서버 폼을 포함한 ASP.NET 페이지에서 다른 페이지로 전송할 때가 있다.
form.aspx
-------------------------------------------------------------------
-------------------------------------------------------------------------------
이와 같이 실행하게 되면 proc.aspx 페이지에서 다음과 같은 오류를 만나게 된다.
Server Error in ‘/’ Application.
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: 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.
아직은 .NET Framework를 많이 사용해보지 못해서 그런지 당황스러울 때가 있다.
단일 서버를 사용 중인데 이와 같은 오류 메시지는 더욱 그러하다.
이런 오류를 해결하기 위해서는 데이터를 받는 페이지에서는 ViewState Mac을 검사하지 않도록 해주면 된다.
proc.aspx
-------------------------------------------------------------------------
-------------------------------------------------------------------------------------
물론 web.config 파일에서 <pages enableViewStateMac=”false”/> 와 지정할 수도 있다.
자료
'프로그래밍 > ASP.NET' 카테고리의 다른 글
ASP.NET 파일형식 (0) | 2010.01.29 |
---|---|
ASP.NET을 이용한 엑셀(Excel) 파일 읽어오기 (0) | 2010.01.26 |
SmtpClient로 Gmail 계정으로 메일 보내기 (0) | 2009.12.14 |
asp.net 2.0 SMTP 메일 보내기 (0) | 2009.08.20 |
Enterprise Library 어플리케이션 블럭 사용하기 5 (0) | 2009.05.14 |
COM+ 등록방법 (0) | 2009.02.19 |
닷넷 개발자 면접 (0) | 2009.02.06 |
웹사이트를 업데이트 하는 중이라면 App_offline.htm 를 사용하세요 (0) | 2009.02.06 |