2009-09-18 74 views
1

Visual Studio 2008 .NET 3.5TinyMCE和Viewstate驗證失敗。原因:Viewstate無效

我正在使用內置的Web服務器來測試,並且一切正常。我的TinyMCE的代碼如下:

<!-- TinyMCE --> 
<script type="text/javascript" src="/tiny_mce/tiny_mce.js"></script> 
<script type="text/javascript"> 
    tinyMCE.init({ 
     // General options 
     mode: "textareas", 
     theme: "advanced", 
     plugins: "paste", 
     relative_urls: false, 
     remove_script_host: false, 

     // Theme options 
     theme_advanced_buttons1: "bold,italic,link,unlink,image", 
     theme_advanced_buttons2: "", 
     theme_advanced_buttons3: "", 
     theme_advanced_toolbar_location: "top", 
     theme_advanced_toolbar_align: "left", 
     theme_advanced_statusbar_location: "bottom", 
     theme_advanced_resizing: false, 

     // Example word content CSS (should be your site CSS) this one removes paragraph margins 
     content_css: "includes/tinyMCEword.css", 

     // Drop lists for link/image/media/template dialogs 
     external_image_list_url: "lists/image_list.js" 
    }); 
</script> 
<!-- /TinyMCE --> 

現在,我遇到的問題,是對我有這樣的代碼的任何網頁,我會間歇性地得到ViewState的錯誤,即:

事件代碼: 4009 事件消息:Viewstate驗證失敗。原因:Viewstate無效。

我注意到發生這種情況時,在我的頁面上,看起來好像我輸出了ViewState數據(加密的)。僅在帶有TinyMCE的頁面上。我不知道爲什麼發生。一切工作完全正常本地,但是當部署到Win2K3服務器(IIS6),我得到這個問題。

我真的迷路了。任何想法傢伙?

感謝, 史蒂夫

+0

FWIW,它似乎是*僅*發生在Chrome上。 – StephenPAdams 2009-09-18 20:30:55

回答

0
我有我的網站完全相同的問題

。部分視圖狀態數據在頁面頂部可見。在當地正常工作。即使我的JavaScript代碼與你的非常相似。

只發生在webkit瀏覽器(safari/chrome)上。

看來,tinyMCE在視圖狀態內隨機放置了一個.js文件(tiny_mce/themes/advanced/langs/en.js),從而破壞了它。

我嘗試了不同版本的tinyMCE,改變了javascript代碼。目前爲止沒有任何工作

任何人有任何想法?

+0

是的,我仍在等待對此的迴應。任何人都有幸運? – StephenPAdams 2009-10-13 20:51:03

+1

我仍在尋找更好的解決方案,但將tinyMCE語言更改爲除英語以外的任何語言都對我有用。例如: 語言:「tr」, 但是由於語言文件未加載,因此不再有按鈕上的描述性文本。 – Tom 2009-10-14 20:26:40

1

看起來你沒有在head標籤中的init調用,但我的一個同事剛剛遇到類似的問題,這是由於頭部調用init的結果。將呼叫轉移到自己的標籤後,一切正常。

希望這至少可以幫助別人!