Note that there are some explanatory texts on larger screens.

plurals
  1. PORefresh an updatepanel on buttonclick from code-behind
    text
    copied!<p>I'm using a Gridview that is using datasource &amp; databinding. When i reload the page the gridview is updated but I want it to be on the buttonclick, but it's not working for me.</p> <p>The gridview inside the updatepanel:</p> <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt; &lt;/asp:ScriptManager&gt; &lt;asp:UpdatePanel ID="upWall" runat="server" ChildrenAsTriggers="true" UpdateMode="conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:GridView ID="gvWallPosts" runat="server" AutoGenerateColumns = "false" CaptionAlign="NotSet" CellPadding="5"&gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderText="Avsändare"&gt; &lt;ItemTemplate&gt; &lt;%# GetSender((int)Eval("WallSender"))%&gt; &lt;br /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText="Inlägg"&gt; &lt;ItemTemplate&gt; &lt;%# Eval("Post")%&gt; &lt;br /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;asp:TextBox ID="txtWall" runat="server" Height="105px" TextMode="MultiLine" Width="227px"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;asp:Button ID="btnWall" runat="server" Text="Posta" onclick="btnWall_Click" /&gt; </code></pre> <p>Code-behind:</p> <pre><code>protected void btnWall_Click(object sender, EventArgs e) { con.SendWallPost(con.GetId(Membership.GetUser().UserName), Convert.ToInt32(Request.QueryString["ID"]), txtWall.Text); //This method is sending the post upWall.Update(); } </code></pre> <p>So, I want the updatepanel to be updated on the ButtonClick, I don't want to reload the whole page to see the result</p>
 

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