modal dialog not gen javascript and stylesheet in Custom Ed

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
shahabksh
User
Posts: 9

modal dialog not gen javascript and stylesheet in Custom Ed

Post by shahabksh »

hi

I create Custom Edit Tag that Includes Four sections

1- html code
2- <script> .... </script>
3- Script (Global)
4- StyleSheet (Global)

on normal mode (Without Modal Dialog) worked perfectly

but on (Modal Dialog) i check source code sections 1 (html code) genereate but sections 2,3,4 not generate


shahabksh
User
Posts: 9

Post by shahabksh »

{{{old_tag}}}

  <div class="input-group">
       <div class="input-group-addon" data-mddatetimepicker="true" data-trigger="click" data-targetselector="#C_{{{id}}}">
                  <span class="glyphicon glyphicon-calendar"></span>
       </div>
       <input type="text" value='@AspNetMaker2018.Models.project1.ConvertToShamsi({{{value}}})' class="form-control" id="C_{{{id}}}" data-mddatetimepicker="true" data-placement="right" data-englishnumber="true" />
  </div>

  <script>

    $('#{{{id}}}').hide();              
  	$('#C_{{{id}}}').change(function () {
  	    var $this = $(this);
        var _string = $this.val();

        var _array = _string.split('/');
        var _day = parseInt(_array[2]);
        var _moon = parseInt(_array[1]);
        var _year = parseInt(_array[0]);

        var _miladi = jalali_to_gregorian(_year, _moon, _day);

        var _iarray = _miladi.toString().split(",");
        var _iday = parseInt(_iarray[2]);
        var _imoon = parseInt(_iarray[1]);
        var _iyear = parseInt(_iarray[0]);
        var _final_miladi = _iyear.toString() + "/" + _imoon.toString() + "/" + _iday.toString();

        $('#{{{id}}}').val(_final_miladi);
    });

Webmaster
User
Posts: 9427

Post by Webmaster »

Webmaster wrote:
As explained in the help file, {{{value}}} is "the CurrentValue of the field object. It will converted to @<page>.<field>.CurrentValue. Note that it includes the @ tags...

So your code:

@AspNetMaker2018.Models.project1.ConvertToShamsi({{{value}}})

is wrong because the generated code will become @AspNetMaker2018.Models.project1.ConvertToShamsi(@CurrentPage.<field>.CurrentValue).

Also, your method ConvertToShamsi() is a static method and therefore "AspNetMaker2018.Models.project1." is not required.


Post Reply