Your Welcome Dear Friend.
Alireza C
Posts
-
Cant find onClick function in C# -
Cant find onClick function in C#Amit Answer is enough for you to solve your problem but I want to tell you about setting events in Asp.net Forms. When you create control in Asp.net Form and then you want to create event for that,You can create event code in
C#
code ofAsp.net
Page. Because of this you should set the type of event and name of it by tag inAsp.net
page then go to theC#
page of it and create the handle code for your event. For example I want to createonclick
event forbutton
in my page. First you write the button code inAsp.net
Page same as this code:<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
Then go to C# page and create event for that button same as this code:
protected void Button1_Click(object sender, EventArgs e)
{}
The important thing is the name of event in the tag and the name event in c# code should be same. It's very simple and I believe you can do it so if it works let me know.