[CLOSED] Using ContentPlaceHolder will Makes "The state information is invalid for this page and might be corrupted" Exception

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Fabricio,

    But one more question, why my button no response after I mark out the AntiXsrfTokenKey viewstate related code?

    The view code is

    <%@ Page Title="About" Language="C#" MasterPageFile="Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="TestWebForm.About" %>
    
    <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
        <ext:Panel runat="server">
            <Items>
                <ext:FormPanel runat="server">
            <Items>
                <ext:Panel runat="server">
                    <Items>
                        <ext:GridPanel ID="gridOrg" runat="server" Title="医疗机构" ColumnLines="true" Height="200">
                            <TopBar>
                                <ext:Toolbar ID="GridOrgToolbar" runat="server">
                                    <Items>
                                        <ext:Button ID="BtnAdd" Text="新增" runat="server">
                                            <DirectEvents>
                                                <Click OnEvent="OnOrgCreate" />                                  
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                            </TopBar>
                        </ext:GridPanel>
                    </Items>
                </ext:Panel>
                
            </Items>
        </ext:FormPanel>
            </Items>
        </ext:Panel>
        
    </asp:Content>
    code behind is:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    
    namespace TestWebForm {
        public partial class About : Page {
            protected void Page_Load(object sender, EventArgs e) {
    
            }
    
            protected void OnOrgCreate(object sender, DirectEventArgs e) {
                X.Msg.Alert("System Msg", "hello");
            }
        }
    }
    It just return "{}" in resopnse. No Message Dialog


    BTW,
    Your advice is to mark out the viewstate code, right? But this is the code visual studio template generate for us. I think everyone will encounter this problem in new project. Maybe it should be log as bug will be better.
    Last edited by u8621011; Apr 26, 2017 at 1:08 AM.

Similar Threads

  1. Replies: 0
    Last Post: Jan 24, 2014, 4:57 PM
  2. Replies: 7
    Last Post: Dec 19, 2013, 7:16 PM
  3. <%@ Page Language="C#" Buffer="false" %>
    By zanotto in forum 2.x Help
    Replies: 2
    Last Post: Nov 21, 2013, 4:32 PM
  4. Replies: 2
    Last Post: Jun 26, 2011, 1:59 AM
  5. Replies: 1
    Last Post: Mar 13, 2011, 9:21 AM

Posting Permissions