c# - JavaScript executes and works on MSVS but doesn't work when published -


i working lightswitch, , using javascript hide buttons based on current user permissions. following tutorial msdn:

https://msdn.microsoft.com/en-us/library/ff852062.aspx

this page

/// <reference path="~/generatedartifacts/viewmodel.js" />  myapp.inicio.visualizaragenda_execute = function (screen) { window.location = "../webforms/agenda.aspx"; }; myapp.inicio.visualizarcorridaexecutadacompleta_execute = function (screen) { // write code here. window.location = "../webforms/corridaexecutadacorridacompleta.aspx"; };  myapp.inicio.coletamotoristacorridas_execute = function (screen) { window.location = "../webforms/coletamotoristacorrida.aspx"; };  myapp.inicio.created = function (screen) { //screen.getcanexecuteclientes().then(function success() { //    screen.findcontentitem("showbrowseclientes").isvisible = true; //}, function error() { //    screen.findcontentitem("showbrowseclientes").isvisible = false; //})  //screen.getcanexecutemotoristas().then(function success() { //    screen.findcontentitem("showbrowsemotoristas").isvisible = true; //}, function error() { //    screen.findcontentitem("showbrowsemotoristas").isvisible = false; //})  //screen.getcanexecuteveiculos().then(function success() { //    screen.findcontentitem("showbrowseveiculoes").isvisible = true; //}, function error() { //    screen.findcontentitem("showbrowseveiculoes").isvisible = false; //})  screen.getcanexecuteenderecoscorrida().then(function success() {     screen.findcontentitem("showbrowseenderecocorridas").isvisible = true; }, function error() {     screen.findcontentitem("showbrowseenderecocorridas").isvisible = false; })  screen.getcanexecutecorridas().then(function success() {     screen.findcontentitem("showbrowserotas").isvisible = true; }, function error() {     screen.findcontentitem("showbrowserotas").isvisible = false; })  screen.getcanexecutecorridasagendadas().then(function success() {     screen.findcontentitem("showbrowseprogramacoesrota").isvisible = true; }, function error() {     screen.findcontentitem("showbrowseprogramacoesrota").isvisible = false; })  screen.getcanexecutecorridasexecutadas().then(function success() {     screen.findcontentitem("showbrowsecorridaesporadicas").isvisible = true;     screen.findcontentitem("showbrowsecorridas").isvisible = true; }, function error() {     screen.findcontentitem("showbrowsecorridaesporadicas").isvisible = false;     screen.findcontentitem("showbrowsecorridas").isvisible = false; })  screen.getismotoristaquery().then(function success() {     screen.findcontentitem("cadastros").isvisible = false;     screen.findcontentitem("fechamento").isvisible = false;     screen.findcontentitem("relatorios").isvisible = false;     screen.findcontentitem("basicos").isvisible = false;     //screen.findcontentitem("showbrowsecoletamotoristacorridas").isvisible = true; }, function error() {     screen.findcontentitem("cadastros").isvisible = true;     screen.findcontentitem("fechamento").isvisible = true;     screen.findcontentitem("relatorios").isvisible = true;     screen.findcontentitem("basicos").isvisible = true;     //screen.findcontentitem("showbrowsecoletamotoristacorridas").isvisible = false; })  }; 

my problem is: when on debug, works perfect. when deploy on own computer, still works. when deploy on windows server hosted on iis , nothing happens.

tested both browsers(local inside server, , local on development computer, not on same network server)

if using id of controls coping rendered html yes may not work when deploy it. must use class selector in jquery acheave or find real id of content item or can use static id if using .net 4 , above.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -