Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display a response from aspx page using jquery ajax
    primarykey
    data
    text
    <p>I am using <code>ajax jquery</code> to request a <code>aspx</code> page and this page displays a <code>GidView</code>, so the response will be the html code for the grid view. and I add the response to DIV to show the result, when I make the request in the first time it works fine, but in the second time nothing added from the response, despite there are a data to bind. </p> <p>** This problem appear ONLY in IE browsers in FireFox, it si OK ! **</p> <p>ajax request :</p> <pre><code> function getSubTraning(mainId) { $(".res" + mainId).html(""); startLoad(); $.ajax({ url: "ajax/GetSubTraining.aspx", data: { mainId: mainId }, success: function (a) { stopLoad(); $(".res" + mainId).append(a); } }); } </code></pre> <p><em>GetSubTraining.aspx html code</em></p> <pre><code>&lt;%@ Page Language="VB" AutoEventWireup="false" CodeFile="GetSubTraining.aspx.vb" Inherits="Admin_ajax_GetSubTraining" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:GridView ID="gvSubTraning" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" EnableModelValidation="True" ForeColor="Black" GridLines="Horizontal" Width="100%" DataSourceID="SqlDataSource1"&gt; &lt;EmptyDataTemplate&gt; No sub training to view ! &lt;/EmptyDataTemplate&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="Train_S_Desc_Ar" HeaderText="Sub training needs" SortExpression="Train_S_Desc_Ar"&gt; &lt;HeaderStyle HorizontalAlign="Left" /&gt; &lt;ItemStyle HorizontalAlign="Left" Width="95%" /&gt; &lt;/asp:BoundField&gt; &lt;asp:TemplateField ShowHeader="False"&gt; &lt;ItemStyle Width="5%" /&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField SortExpression="Train_S_Indx"&gt; &lt;ItemTemplate&gt; &lt;input type="button" class='btnRemoveSub' title="&lt;%# Eval("Train_S_Indx") %&gt;-&lt;%# Eval("Train_M_Indx") %&gt;" value="Remove" /&gt; &lt;/ItemTemplate&gt; &lt;EditItemTemplate&gt; &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("Train_S_Indx") %&gt;'&gt;&lt;/asp:TextBox&gt; &lt;/EditItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;FooterStyle BackColor="#CCCC99" ForeColor="Black" /&gt; &lt;HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" /&gt; &lt;PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" /&gt; &lt;%-- &lt;SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" /&gt;--%&gt; &lt;/asp:GridView&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:Con_New %&gt;" SelectCommand="getSubTtraining" SelectCommandType="StoredProcedure"&gt; &lt;SelectParameters&gt; &lt;asp:QueryStringParameter Name="mainId" QueryStringField="mainId" Type="Int32" /&gt; &lt;/SelectParameters&gt; &lt;/asp:SqlDataSource&gt; &lt;/div&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload