最初に私が言いたいのは: はい、私の質問と似ていても同じではない質問がたくさんあることは知っています。
開発者マシンで 12 のサイトの 1 つを開始すると、すべてがうまく機能し、サーバーでも 11 のサイトが問題なく動作します。
12 番目のサイトを開始すると、最初は正常に動作しますが、ポストバック (ボタン、AutoPostBack を使用した DropDownList など) が発生すると、次のエラーが発生します。
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Infoscreen.Anzeigeeinstellungen.Page_Load(Object sender, EventArgs e) in C:\Users\Krusty\Desktop\Schule\Diplomarbeit\Infoscreen\Infoscreen\Anzeigeeinstellungen.aspx.cs:97
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24
System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3047
パス (C:\Users\Krusty\Desktop\Schule\Diplomarbeit\Infoscreen\Infoscreen\Anzeigeeinstellungen.aspx.cs) は、ファイルが私の開発者マシンにあったパスです。しかし、なぜ??プログラムにパスをハードコーディングしたことはなく、サイトを再作成しても機能しませんでした。
何をすればよいでしょうか?ヒント/ヒントをいただければ幸いです。
編集:
91 if (!Page.IsPostBack)
92 {
93 Response.Cookies["Infoscreen_Anzeigeeinstellungen_Ausgewählte_Abteilung"].Value = ausgewählte_Abteilung.ToString();
94 }
95 else
96 {
97 ausgewählte_Abteilung = Request.Cookies["Infoscreen_Anzeigeeinstellungen_Ausgewählte_Abteilung"].Value;
98 }
編集:
はい、IIS は Cookie を使用するように構成されています
編集:
解決しました!VisualStudio2010サーバーでは、文字「ä」は機能します...
IIS7では機能しません...
そのため、Cookieが適切に設定されず、getリクエストがハングアップします
Cookieに「Infoscreen_Anzeigeeinstellungen_Ausgewaehlte_Abteilung」という名前を付けましたが、現在は正常に動作しています
閉じることができます