Adding UpdatePanel to aspx page

Vhjkeffwd

New Member
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? I have a dropdownlist which through I populate the gridview.this is the code:\[code\] <%@ Page Title="All Products" Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="All.aspx.cs" Inherits="Catalog_All" %><asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style4 { width: 100%; } .style5 { width: 620px; } .style6 { font-size: large; text-decoration: underline; } </style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><div> <asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="CategoryName" DataValueField="categoryId" onselectedindexchanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem Value="">choose pet</asp:ListItem> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:AllPets %>" SelectCommand="SelectAllCategories" SelectCommandType="StoredProcedure"> </asp:SqlDataSource> <table class="style4"> <tr> <td colspan="2" class="style6"> <strong>All products</strong></td> </tr> <tr> <td class="style5"> &nbsp;</td> <td> </td> </tr> <tr> <td class="style5"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" AllowPaging="True"> <Columns> <asp:BoundField DataField="ProductName" HeaderText="product" SortExpression="ProductName" /> <asp:ImageField DataAlternateTextField="picPath" DataImageUrlField="picPath" HeaderText="pic"> </asp:ImageField> <asp:BoundField DataField="Price" HeaderText="price" SortExpression="Price" /> <asp:BoundField DataField="Summary" HeaderText="des" SortExpression="Summary" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:get_products_bypet %>" SelectCommand="get_products_bypet" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="categoryId" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> </td> <td> &nbsp;</td> </tr> <tr> <td class="style5"> &nbsp;</td> <td> &nbsp;</td> </tr> <tr> <td class="style5"> &nbsp;</td> <td> &nbsp;</td> </tr> </table></div></asp:Content>\[/code\]tahnx for the help
 
Back
Top