Conditional Statement in Kendo UI template


/ Published in: jQuery
Save to your folder(s)

Example of implementing Conditional (if else) statement in Kendo UI grid template.


Copy this code and paste it in your HTML
  1. template:
  2. "# if (Photo != null) { #" +
  3. "<img class="+"photo" + " src=" + "@Url.Content(@"~/Documents/Userphoto/#=UserId #/#=Photo#")" + " width="+"70px"+" alt="+"image"+" />" +
  4. "# } else { #" +
  5. "<img class="+"photo" + " src=" + "@Url.Content(@"~/Documents/DefaultImage/profile-default.jpg")" + " width="+"70px"+" alt="+"image"+" />" +
  6. "# } #"

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.