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. Image for the cookie policy date

RequireJS for ASP.NET Webform control

Hi!

I use EJ Webform controls in my site: (C#)
www.recognitiongame.com

I want to use RequireJS and have problem with jquery load checking when the page renders the radiobuttons. 

An example from one of my EJRadiobuttons in my .aspx file:
<ej:RadioButton ID="Ujjatekindit_EJRadioButton" runat="server" Name="Ujjatekindit_Radio" OnChange="Ujjatekindit_EJRadioButton_Change"></ej:RadioButton>

In the page rendering, the complier create the radiobutton with this code, not in my js file: ( from the page source )
$("#ContentPlaceHolder1_Ujjatekindit_EJRadioButton").ejRadioButton(.....

How could I check is the Jquery is exist in there with RequireJS?



Regards,
 Imre

3 Replies

BC Berly Christopher Syncfusion Team September 14, 2017 10:29 AM UTC

Hi Imre, 
 
Thanks for contacting Syncfusion support. 
 
We have checked with your query. We were able to reproduce the reported query (“I want to use RequireJS and have problem with jQuery load checking when the page renders the radiobuttons.”).  
 
We would like to let you know that we don’t have requireJS support for ASP.NET web form controls. So, we suggest to use below code in your application to render the Syncfusion controls with requireJS. 
Default.aspx: 
   <input type="radio" id="radioButton" name="radio" /> 
 
      <script type="text/javascript"> 
          require.config({ 
              paths: { 
 
                  "jquery": 'Scripts/jquery-3.1.1.min', 
 
                  "jsrender": 'Scripts/jsrender.min', 
 
              } 
          }); 
          require(["Scripts/ej/web/ej.radiobutton.min"], function () { 
              $("#radioButton").ejRadioButton({ 
                  text:"Fresher" 
              }); 
          }); 
        </script> 
 
We have prepared the sample based on requireJS with JavaScript. Please get the sample from the below location. 
 
  
To know more about requireJS please refer the below Documentation link. 
 
 
Regards, 
Berly B.C 



IR Imre Revesz September 14, 2017 11:31 AM UTC

Dear Berly B.C,


Thanks for the reply, I will change my code to that you written.



Regards, 

 Imre



BC Berly Christopher Syncfusion Team September 15, 2017 12:37 PM UTC

Hi Imre, 
 
Thanks for the update. Please get back to us if you need any further assistance on this.  
 
Regards, 
Berly B.C 


Loader.
Up arrow icon