We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

ej:Button onclick not working with C# code behind file

Thread ID:

Created:

Updated:

Platform:

Replies:

128343 Jan 16,2017 07:30 AM Jan 18,2017 10:53 PM ASP.NET Web Forms 3
loading
Tags: Button
Fabian Lorenz
Asked On January 16, 2017 07:30 AM

I'm working with Visual Studio 2015 with a Web Forms Project without a Masterfile page.
I want to have as much code as possible in a C# Code Behind file.
I tried to integrate an ej:Button in my Project, but it won't call the onclick method.
Then i tried the same with an asp:Button and it simply works.
Here is some of my code:
//aspx file:
<ej:Button runat="server" OnClick="onSaveClick"></ej:Button>

//aspx.cs file (the code behind file):
    protected void onSaveClick(object sender, EventArgs e)
    {
        Debug.WriteLine("Saved");
    }

Generally speaking, i have a hard time following the documentation,the samples and the API.
I searched for ej:Button and other things in all of them and most examples are without a proper C#
way of doing it. Often there is only a javascript way of doing so.

Am I missing some documentation or is this simply the wrong way im trying to program?

Thanks in advance,
Fabian Lorenz

Thirukumaran Murugan [Syncfusion]
Replied On January 17, 2017 11:35 AM

Hi Fabian Lorenz, 
  
Thanks for contacting syncfusion support,  
  
We suspect that server side events might not be triggered due to (ej.webforms.min.js) script file reference missing in the application, so please include the ej.webforms.min.js script file in the page   
For more information visit the below link.  
  
Regards,  
Thirukumaran M.  


Fabian Lorenz
Replied On January 17, 2017 03:52 PM

Thanks for the reply but in the meantime I solved the problem by myself.
I am using the Syncfusion Project Template to generate a project, so
the required files where already there.
My fault was that i forgot to include:

<asp:ScriptManager runat="server"></asp:ScriptManager>

I wouldn't had the problem if I would have used a masterfile in my project.
The template includes the Scriptmanager there by default.
So I guess in the future I will use the Masterfile more often. :)




Francis Paul Antony Raj [Syncfusion]
Replied On January 18, 2017 10:53 PM

Hi Fabian, 
 
We are glad to know that your issue has been resolved. 
 
Please let us know if you need further assistance. 
 
Regards, 
Francis Paul A. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;