我有一個ASP.net表單頁面,充當代理。如何阻止asp.net嘗試加載共享點?
我的網站正在從其他網站companyX.com下載一些內容。
companyX.com的網站使用sharePoint。
我的網站下載從companyX.com的HTML,併成功地將它添加到我的網頁,然而,Page_Init, Page_Load
和Page_Unload
之後,但之前Render
我的網頁拋出粘貼下面的錯誤。
我的網站沒有安裝任何sharepoint。但是,它看起來像是在asp.net中處理我的頁面中的HTML內容,識別一些共享點標記,然後嘗試加載共享點。我很想把它關掉!
我的頁面確實有EnableViewState="false" EnableViewStateMac="false" ValidateRequest="false"
錯誤:
System.Web.HttpException (0x80004005): The state information is invalid for this page and might be corrupted. ---> System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port: 55413
Referer: xxx/App.aspx?id=xxx
Path: /App.aspx
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
ViewState: xxx... ---> System.ArgumentException: The serialized data is invalid. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Web.UI.ObjectStateFormatter.DeserializeType(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream)
--- End of inner exception stack trace ---
at System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter2.Deserialize(String serializedState, Purpose purpose)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
--- End of inner exception stack trace ---
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.app_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
我加<頁面的EnableViewState =「假」 />到web.congig。仍然得到相同的錯誤。 也覆蓋頁面的驗證功能,但沒有效果。 我怎樣才能真正禁用視圖狀態? – MCM