Hi
I have a RadGrid and one of the columns is a button:
<telerik:GridTemplateColumn UniqueName="AgreeColumn"> <ItemTemplate> <asp:Button ID="AgreeButton" runat="server" onClick="AgreeButton_Click" Text="Agree" /> </ItemTemplate> </telerik>When the button is clicked AgreeButton_Click is fired and in the method, I do some databse updates. Only if the dabase updates are successfull, I want to call a Javascript function:
protected void AgreeButton_Click(object sender, EventArgs e) { // do some database work ..... if (success) this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myJS", "myJSFunction();", true); }For some reason, the Javascript function never gets called.
It works, however, if I create a button outside of grid:
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> protected void Button1_Click(object sender, EventArgs e) { // do some database work ..... if (success) this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myJS", "myJSFunction();", true); } What do I have to do to make this work for button in the grid?
Thanks