$create ignored

Thread is closed for posting
2 posts, 0 answers
  1. Russ
    Russ avatar
    49 posts
    Member since:
    Sep 2006

    Posted 30 Dec 2013 Link to this post

    I created a template to insert some javascript into my user control:

    I created a template with the following:

    Sys.Application.add_load(function () {
    $create(Company.Controls.REPLACEME, null, null, null, $get('<%=Me.ClientID%>'));
    var ctl = $find('<%= Me.ClientID%>');

    This was the output:

    Sys.Application.add_load(function () {



    var ctl =

    The issue is related to the $create and $find in the template.  Any way around this?

  2. Ivan
    Ivan avatar
    106 posts

    Posted 02 Jan 2014 Link to this post


    Since JustCode uses the "$" symbol for defining variables in the templates, you need to escape it by adding a second "$". That is - your template should look something like:
    Sys.Application.add_load(function () {<BR>$$create(Company.Controls.REPLACEME,
    null, null, null, $$get('<%=Me.ClientID%>'));<BR>var ctl = $$find('<%=
    Me.ClientID%>');<BR>ctl.setup();<BR> });<BR>

    Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
Back to Top