クロスドメインにデータを投稿しようとしています。フォームがrunat="server"を使用していない場合は正常に機能し、フォームがrunat = "server"を使用している場合は、投稿中に500の内部エラーが発生します。
デバッグ時に、問題がページ上に自動生成された__viewstateコードにあることを確認しました。以下のコードを見つけてください。
クライアント側のHTML実装:
<%@ Page Language="C#" CodeFile="Sample.aspx.cs" Inherits="Sample" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta charset="utf-8">
    <title>Untitled Page</title>
    <link href="FileUpload.css" rel="stylesheet" type="text/css" />
   <script id="template-upload" type="text/x-tmpl">
    </script>
    <script id="template-download" type="text/x-tmpl">
    </script>
    <script src="../../test/FileUpload/jQueryv1.6.2.js"></script>
    <script src="fileupload-js/jquery.ui.widget.js"></script>
    <script src="fileupload-js/tmpl.min.js"></script>
    <script src="fileupload-js/jquery.fileupload.js"></script>
    <script src="fileupload-js/jquery.fileupload-ui.js"></script>
    <script src="fileupload-js/locale.js"></script>
    <script src="fileupload-js/main.js"></script>    
</head>
<body>
<form id="fileupload" method="POST" runat="server">
    <CCAB.Web:FileUpload runat="server"/>
</form>
</body>
</html>
サーバーサイドコード:
public partial class SaveFile : System.Web.UI.Page
{
    private void Page_Load(object sender, System.EventArgs e)
    {
        Response.AddHeader("Access-Control-Allow-Origin", "*")
        if (Request.HttpMethod == "GET" || Request.HttpMethod == "HEAD")
        {
            Response.Write("GET Success");
        }
        else
        {
            for (int i = 0; i < Request.Files.Count; i++)
            {
                string filename = Request.Files[i].FileName;
                Request.Files[i].SaveAs(@"\\dev2\\share$\\Anna\\test\\" + filename);
                Response.Write(filename);
            Response.Write("Success");
            }
        }
    }
}
クライアント側から非表示のビューステートコードを無視する方法、またはサーバー側の応答ビューステートを無視する方法について教えてください。
どうもありがとうアンナ