I am desinging a form in ASP coding, If i give a button code in .aspx page it should be called out in aspx.cs page in C# code, can i know the key or how to call out, if we enter button, gridview it should be called out in C# page, i have attached screenshot for your reference.
.ASPX
ASPX.cs
RahulPosted Jul 21, 2017, 9:09 AM
First, Make sure you have included “CodeBehind” property value in the page directive like below highlighted –
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
Second, attach “OnClick” event of the button in source file like below –
<asp:Button ID="button1" runat="server" Text="Insert" Font-Bold="true" OnClick="button1_Click"/>
Third, Add event handler method into your code-behind file like below –
protected void button1_Click(object sender, EventArgs e)
{
}
Hope, this helps you. Have a great day!