Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am getting error while am using UpdatePanel in the Page with GridView
My code is
XML
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="scriptmanagernew" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="updatepanelnew" runat="server"><ContentTemplate>
    <table border="0" cellspacing="0" cellpadding="0" style="width: 949px">
        <tr>
            <td width="220" valign="top">
                <table width="220" border="0" align="center" cellpadding="0" cellspacing="0" class="Sidemenu_bottem">
                    <tr>
                        <td colspan="3" valign="middle" class="Quicklink_top">
                            <table width="163" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="32" height="33">
                                    </td>
                                    <td width="131">
                                        Careers
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td width="9" height="300">
                            &nbsp;
                        </td>
                        <td width="217" valign="top">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="20">
                                        <a href="joinourteam.htm" class="submenu" target="_top">Join our team</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="20">
                                        <a href="explorejobs.aspx" class="submenu"><strong>Explore jobs</strong> </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td id="tdRegisterNow" runat="server" visible="false" height="20">
                                        &nbsp;&nbsp;&nbsp; <a href="UserRegistration.aspx" class="submenu">
                                            Register now</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td id="tdMyProfile" runat="server" height="20">
                                        &nbsp;&nbsp;&nbsp; <a href="UserLogin.aspx" class="submenu">My
                                            Profile</a>
                                    </td>
                                </tr>
                                <tr>
                                    <td id="tdViewJobs" runat="server" visible="false" height="20">
                                        &nbsp;&nbsp;&nbsp; <a href="ViewJobs.aspx" class="submenu">Applied Jobs
                                            </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td id="tdMyAccount" runat="server" visible="false" height="20">
                                        &nbsp;&nbsp;&nbsp; <a href="MyAccount.aspx" class="submenu">
                                            My Account</a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="10">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
            <td width="729" valign="top" align="center">
                <table width="670" border="0" align="center" cellpadding="0" cellspacing="0" class="innertextbox_bottem">
                    <tr>
                        <td colspan="3" class="innertextbox_top">
                            <table style="height: 10px" cellpadding="5">
                                <tr style="border-style: outset">
                                    <td align="left" width="340">
                                        <span class="innerpage-header">&nbsp;&nbsp;Explore jobs</span>
                                    </td>
                                    <td align="right" width="250">
                                        <asp:Label class="LoginData" ID="lblUserName" runat="server"></asp:Label>
                                    </td>
                                    <td width="60">
                                        <asp:LinkButton class="LoginData" ID="lnkLogOut" runat="server" Visible="False" OnClick="lnkLogOut_Click">&lt;Logout&gt;</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td width="12">
                            &nbsp;
                        </td>
                        <td width="650" valign="top" align="center" colspan="2">
                            <p align="center">
                                <asp:Label ID="lblApplied" runat="server" Visible="False" ForeColor="#3399FF"></asp:Label>
                            </p>
                            <p align="center">
                                Enter/Select one or more search criteria below to view the opportunities:
                            </p>
                            <asp:Panel ID="Panel1" runat="server">
                            <table align="center" border="0" cellpadding="3" cellspacing="0">
                                <tr>
                                    <td align="right" style="height: 23px">
                                        Keyword:
                                    </td>
                                    <td align="left" style="height: 23px">
                                        <asp:TextBox ID="txtKeyword" runat="server" Width="170px"></asp:TextBox>
                                    </td>
                                    <td width="170Px" align="left" style="height: 23px">
                                        Ex: vb,dotnet,java,c#.
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        Country:
                                    </td>
                                    <td align="left">
                                        <asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True" Font-Size="Larger"
                                            Width="176px" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        State:
                                    </td>
                                    <td align="left">
                                        <asp:DropDownList ID="ddlState" runat="server" Font-Size="Larger" Width="176px">
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3" align="center">
                                        <br />
                                        <asp:Button class="ASPbutton" ID="btnSearch" runat="server" Text="Search" CausesValidation="False"
                                            BackColor="Black" ForeColor="White" Width="65px" OnClick="btnSearch_Click"></asp:Button>
                                        &nbsp;&nbsp;&nbsp;
                                        <asp:Button class="ASPbutton" ID="btnClearSearch" runat="server" Text="Clear Search"
                                            CausesValidation="False" BackColor="Black" ForeColor="White" Width="100px" OnClick="btnClearSearch_Click">
                                        </asp:Button>
                                        <br />
                                        <br />
                                    </td>
                                </tr>
                            </table>
                                   </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center" >
                            <asp:Panel ID="pnlDgJobDetailsFound" runat="server" ScrollBars="Auto"
                                Visible="false">
                                <asp:GridView ID="dgSrchJobDetailsFound" runat="server" align="center" AutoGenerateColumns="False"
                                    AllowSorting="True" Width="96%" CellPadding="3" ForeColor="#333333" DataKeyNames="JobId"
                                    GridLines="None" OnSelectedIndexChanged="dgSrchJobDetailsFound_SelectedIndexChanged">
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    <Columns>
                                        <asp:CommandField CausesValidation="False" InsertVisible="False" ShowCancelButton="False"
                                            ShowSelectButton="True" />
                                        <asp:BoundField DataField="JobCode" HeaderText="JobCode" ReadOnly="True" />
                                        <asp:BoundField DataField="Title" HeaderText="Title" />
                                        <asp:BoundField DataField="CityName" HeaderText="Job Location" />
                                    </Columns>
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <EditRowStyle BackColor="#999999" />
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                </asp:GridView>
                                <br />
                            </asp:Panel>
                            <asp:Label ID="lblRecordsFound" runat="server" Text="" Visible="false" ForeColor="#0066FF"></asp:Label>
                            <br />
                            <br />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hfExplore" runat="server" />
    </ContentTemplate>
<pre lang="xml"><Triggers >
   <asp:AsyncPostBackTrigger ControlID="dgSrchJobDetailsFound" EventName="SelectedIndexChanged" />
   </Triggers>


</asp:UpdatePanel>
</asp:Content>


When I click on the select button, which is inside the gridview, I am getting the following error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near
Posted
Updated 1-Dec-10 21:37pm
v4
Comments
Dalek Dave 2-Dec-10 3:37am    
Edited for Grammar and Readability.

Have a look at various possible reasons and resolutions for the same here[^]. Few useful links from it:
Link 1[^]
Link 2[^]
Link 3[^]
 
Share this answer
 
Comments
Dalek Dave 2-Dec-10 3:37am    
Good Links.
Use PostBackTrigger instead of AsyncPostBackTrigger. For more info have a look at these.

Link 1[^]
Link 2[^]
 
Share this answer
 
Comments
Vigneshb6 2-Dec-10 5:42am    
Thank you thatraja it solved.................

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900