Mangal Pandey
Mangal Pandey

Reputation: 109

Event of controls on othe page not being fired and gives error

This is How I loadan aspx page in a div

<script type="text/javascript">
    $(function () {

        setInterval(function () {
            $('#div1').load('frmChatRequest.aspx', function () {

            });
        }, 10000);
    });

</script>

But I got one Problem, which is I have grid view controls like button field and their event is not firing and it is giving this error "The state information is invalid for this page and might be corrupted." What should I do? this is the errorenter image description here

This is frmChatRequest.aspx page

<%@ Page EnableEventValidation="false" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="frmChatRequest.aspx.cs"   Inherits="Chat_frmChatRequest" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">



</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="divConversation" 
        style=" width: 101%; height:174px; overflow:auto; overflow-x:hidden">
    <asp:GridView S ID="gdvChatRequestRoom" style="background-color:ALICEBLUE;"
        runat="server" AutoGenerateColumns="false"  Width="358px" Height="57px" GridLines="Horizontal"
        BorderStyle="None" BorderColor="Black" 
        OnRowCommand="gdvChatRequestRoom_RowCommand"  >
        <Columns>
            <asp:TemplateField  ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>

                    <asp:HiddenField ID="hdnAddPeople" Value='<%#Eval("Q116001") %>' runat="server" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Chat Title" DataField="Q116003" ItemStyle-HorizontalAlign="Left">
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField HeaderText="Request By "  DataField="LOG2002" ItemStyle-HorizontalAlign="Left">
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:BoundField>
            <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Action">
                <ItemTemplate>
                    <asp:Button ID="btnAccept" CausesValidation="false" runat="server" Text="Accept" CommandName="Accept" CommandArgument='<%# Eval("Q116002") %>'>
                    </asp:Button>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:TemplateField>

                 <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="" >
                <ItemTemplate>
                 <asp:Button ID="btnReject" CausesValidation="false" runat="server" Text="Reject" CommandName="Reject" CommandArgument='<%# Eval("Q116002") %>'>
                </asp:Button>
                </ItemTemplate>

                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle BorderStyle="None" />
    </asp:GridView>
    </div>


    <div>
     <marquee runat="server" id="myMarqueeChatRequest" direction=left scrollamount="11" scrolldelay="200" style="color:Red;background-color:ALICEBLUE;"></marquee>

  </div>
</asp:Content>

Upvotes: 0

Views: 78

Answers (1)

JoeG
JoeG

Reputation: 136

can you check the path of the url if the file exist? and do you want to execute the frmChatRequest.aspx file ever 10000 milisecond? if no use the setTimeout instead.

just like this

<script type="text/javascript">
    $(function () {

        setTimeout(function () {
            $('#div1').load('frmChatRequest.aspx', function () {

            });
        }, 10000);
    });

</script>

Upvotes: 2

Related Questions