Cant find onClick function in C#
-
i m very new in C# ,in my clients registration form
<td align="center" style="font-family: tahoma; font-size: 11px;">
<asp:Button ID="Button1" runat="server" Font-Names="Tahoma" Font-Size="11px" Height="22px"
OnClick="Button1_Click" Text="Register" Width="74px" OnClientClick="return IsEmpty();" />
</td>on click button1_click function is geting called,but i can not find button1_click,nad if i remove the function its not getting postback ASP.registration_aspx' does not contain a definition for 'Button1_C' and no extension method 'Button1_C' accepting a first argument of type 'ASP.registration_aspx' could be found (are you missing a using directive or an assembly reference?) Plz help me to find solution for it
Thnx in Advance
-
i m very new in C# ,in my clients registration form
<td align="center" style="font-family: tahoma; font-size: 11px;">
<asp:Button ID="Button1" runat="server" Font-Names="Tahoma" Font-Size="11px" Height="22px"
OnClick="Button1_Click" Text="Register" Width="74px" OnClientClick="return IsEmpty();" />
</td>on click button1_click function is geting called,but i can not find button1_click,nad if i remove the function its not getting postback ASP.registration_aspx' does not contain a definition for 'Button1_C' and no extension method 'Button1_C' accepting a first argument of type 'ASP.registration_aspx' could be found (are you missing a using directive or an assembly reference?) Plz help me to find solution for it
Thnx in Advance
just check registration.aspx.cs and let us know....
-
i m very new in C# ,in my clients registration form
<td align="center" style="font-family: tahoma; font-size: 11px;">
<asp:Button ID="Button1" runat="server" Font-Names="Tahoma" Font-Size="11px" Height="22px"
OnClick="Button1_Click" Text="Register" Width="74px" OnClientClick="return IsEmpty();" />
</td>on click button1_click function is geting called,but i can not find button1_click,nad if i remove the function its not getting postback ASP.registration_aspx' does not contain a definition for 'Button1_C' and no extension method 'Button1_C' accepting a first argument of type 'ASP.registration_aspx' could be found (are you missing a using directive or an assembly reference?) Plz help me to find solution for it
Thnx in Advance
hi, As you are new with .NET , follow below simple step. 1) remove this button from page. 2) add button control through drag and drop 3) double click on button. step 3 should create click event of the button and it should also create event handler in code behind page. let us know if it works for you. thanks -Amit.
-
just check registration.aspx.cs and let us know....
i cant find registration.aspx.cs in the folder
-
just check registration.aspx.cs and let us know....
i cant find registration.aspx.cs in the folder only 4 aspx files are dere
-
i m very new in C# ,in my clients registration form
<td align="center" style="font-family: tahoma; font-size: 11px;">
<asp:Button ID="Button1" runat="server" Font-Names="Tahoma" Font-Size="11px" Height="22px"
OnClick="Button1_Click" Text="Register" Width="74px" OnClientClick="return IsEmpty();" />
</td>on click button1_click function is geting called,but i can not find button1_click,nad if i remove the function its not getting postback ASP.registration_aspx' does not contain a definition for 'Button1_C' and no extension method 'Button1_C' accepting a first argument of type 'ASP.registration_aspx' could be found (are you missing a using directive or an assembly reference?) Plz help me to find solution for it
Thnx in Advance
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.
-
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.
thanks for mention my name in your answer :)
-
thanks for mention my name in your answer :)