How do I call a code-behind method from my markup?
I want to call this method in the OnClick event as shown below: AddRow()
Code:<asp:TemplateField> <HeaderTemplate> <asp:Button ID="AddButton" runat="server" Text="Add" OnClick='<%#AddRow()%>' /> </HeaderTemplate> <ItemStyle HorizontalAlign="Center" /> <ItemTemplate> <asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" CommandArgument='<%# Container.DataItemIndex %>' CommandName="Delete" Text="Delete"></asp:LinkButton> </ItemTemplate> </asp:TemplateField>




Reply With Quote