Tkmstr1009
New Member
I have an update panel in a GridView Row. I have followed all the standard procedure to update the panel from the code behind but nothing seems to work..\[code\] <asp:UpdatePanel ID="UpdatePanelBoost" runat="server" RenderMode="Inline" UpdateMode="Conditional"> <ContentTemplate > <asp:LinkButton ID="LinkButtonBoost" runat="server" Font-Size="XX-Small" Text="Boost Up" OnCommand="LinkButtonBoost_Command"></asp:LinkButton> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="LinkButtonBoost" EventName="Command"/> </Triggers> </asp:UpdatePanel>\[/code\]Codebhind \[code\] protected void LinkButtonBoost_Command(object sender, CommandEventArgs e){ HiddenField HiddenFieldId = (HiddenField)GridView2.Rows[0].FindControl("HiddenFieldId"); LinkButton Boostupbutton= (LinkButton)sender; int SId= Convert.ToInt32(HiddenFieldSubjectId.Value); int QId =Convert.ToInt32(GridView2.DataKeys[0].Value.ToString ()); UpdatePanel UpdatePanelBoost = (UpdatePanel)GridView2.Rows[0].FindControl("UpdatePanelBoost"); if (e.CommandName == "Boost Up") { QuestionDataAccess.InsertQuestionBoost(QId, new Guid(Membership.GetUser().ProviderUserKey.ToString()), SId); Boostupbutton.CommandName = "Boost Down"; Boostupbutton.CommandArgument = "Boost Down"; UpdatePanelBoost.Update(); } if(e.CommandName=="Boost Down") { if (QuestionDataAccess.RemoveQuestionBoost(new Guid(Membership.GetUser().ProviderUserKey.ToString()), QId)) { Boostupbutton.CommandArgument = "Boost Up"; Boostupbutton.CommandName = "Boost Up"; UpdatePanelBoost.Update(); } }\[/code\]}