Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding UpdatePanel to aspx page
    primarykey
    data
    text
    <p>I would appriciate your help. I'm trying to add an updatepanel to my page so it only refresh the gridview and not the hole page. i've to inseret it in different places but it doesnt seem to work, still the hole page is refreshed. where should I insert it? </p> <p>I have a dropdownlist which through I populate the gridview. this is the code:</p> <pre><code> &lt;%@ Page Title="All Products" Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="All.aspx.cs" Inherits="Catalog_All" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"&gt; &lt;style type="text/css"&gt; .style4 { width: 100%; } .style5 { width: 620px; } .style6 { font-size: large; text-decoration: underline; } &lt;/style&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&gt; &lt;div&gt; &lt;asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="CategoryName" DataValueField="categoryId" onselectedindexchanged="DropDownList1_SelectedIndexChanged"&gt; &lt;asp:ListItem Value=""&gt;choose pet&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="&lt;%$ ConnectionStrings:AllPets %&gt;" SelectCommand="SelectAllCategories" SelectCommandType="StoredProcedure"&gt; &lt;/asp:SqlDataSource&gt; &lt;table class="style4"&gt; &lt;tr&gt; &lt;td colspan="2" class="style6"&gt; &lt;strong&gt;All products&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="style5"&gt; &amp;nbsp;&lt;/td&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="style5"&gt; &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" AllowPaging="True"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="ProductName" HeaderText="product" SortExpression="ProductName" /&gt; &lt;asp:ImageField DataAlternateTextField="picPath" DataImageUrlField="picPath" HeaderText="pic"&gt; &lt;/asp:ImageField&gt; &lt;asp:BoundField DataField="Price" HeaderText="price" SortExpression="Price" /&gt; &lt;asp:BoundField DataField="Summary" HeaderText="des" SortExpression="Summary" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:get_products_bypet %&gt;" SelectCommand="get_products_bypet" SelectCommandType="StoredProcedure"&gt; &lt;SelectParameters&gt; &lt;asp:ControlParameter ControlID="DropDownList1" Name="categoryId" PropertyName="SelectedValue" Type="Int32" /&gt; &lt;/SelectParameters&gt; &lt;/asp:SqlDataSource&gt; &lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="style5"&gt; &amp;nbsp;&lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="style5"&gt; &amp;nbsp;&lt;/td&gt; &lt;td&gt; &amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/asp:Content&gt; </code></pre> <p>tahnx for the help </p>
    singulars
    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.
 

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