将更新面板与GridView一起使用时出现错误
问题描述:
嗨
在带有GridView的页面中使用UpdatePanel时出现错误
我的代码是
Hi
I am getting error while am using UpdatePanel in the Page with GridView
My code is
<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">
</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">
<a href="UserRegistration.aspx" class="submenu">
Register now</a>
</td>
</tr>
<tr>
<td id="tdMyProfile" runat="server" height="20">
<a href="UserLogin.aspx" class="submenu">My
Profile</a>
</td>
</tr>
<tr>
<td id="tdViewJobs" runat="server" visible="false" height="20">
<a href="ViewJobs.aspx" class="submenu">Applied Jobs
</a>
</td>
</tr>
<tr>
<td id="tdMyAccount" runat="server" visible="false" height="20">
<a href="MyAccount.aspx" class="submenu">
My Account</a>
</td>
</tr>
</table>
</td>
<td width="10">
</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"> 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"><Logout></asp:LinkButton>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="12">
</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>
<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
答
Have a look at various possible reasons and resolutions for the same here[^]. Few useful links from it:
Link 1[^]
Link 2[^]
Link 3[^]
Have a look at various possible reasons and resolutions for the same here[^]. Few useful links from it:
Link 1[^]
Link 2[^]
Link 3[^]
Use PostBackTrigger instead of AsyncPostBackTrigger. For more info have a look at these.
Link 1[^]
Link 2[^]
Use PostBackTrigger instead of AsyncPostBackTrigger. For more info have a look at these.
Link 1[^]
Link 2[^]