Partage
  • Partager sur Facebook
  • Partager sur Twitter

Failed to load resource: the server responded with

Failed to load resource: the server responded with a status of 500

    6 décembre 2019 à 22:13:29

    voici le vieux code qui pose probleme 
    quand la fenetre est ouverte le bouton OK ne fonctionne pas 

    depuis plusieurs semaines j'ai cet erreur que je n'arrive pas resoudre

    j'ai tout essaye en vain

    merci de m'aider

    private void ShowargumentDialog(GridViewRow gridViewRow)
            {
                MesEntities db = new MesEntities();
                StringBuilder javascript = new StringBuilder();
                StringBuilder html = new StringBuilder();
                int fournisseurID = Convert.ToInt32(Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.fournisseurID].Text).Trim());
                string fournisseurCode = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.fournisseurCode].Text).Trim();
                string fournisseurNom = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.fournisseurNom].Text).Trim();
                int domaineID = Convert.ToInt32(Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.domaineID].Text).Trim());
                string domaineCode = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.domaineCode].Text).Trim();
                string domaineDescr = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.domaineDescr].Text).Trim();
                string domaineDateOuverture = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.domaineDateOuverture].Text).Trim();
                string domaineDateFermeture = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.domaineDateFermeture].Text).Trim();
                int statutID = Convert.ToInt32(Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.StatutID].Text).Trim());
                string statut = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.Statut].Text).Trim();
                int ardID = Convert.ToInt32(Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.ARDID].Text).Trim());
                string ardCode = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.ARDCode].Text).Trim();
                string ardNom = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.ARDNom].Text).Trim();
                int asdID = Convert.ToInt32(Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.ASDID].Text).Trim());
                string asdCode = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.ASDCode].Text).Trim();
                string asdNom = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.ASDNom].Text).Trim();
                string soldeTIC = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.SoldeTIC].Text).Trim();
                string soldeDIFF = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.SoldeDIFF].Text).Trim();
                string soldeB = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.SoldeB].Text).Trim();
                string soldeEE = Server.HtmlDecode(gridViewRow.Cells[(int)EnumColumns.SoldeEE].Text).Trim();
                if (Double.Parse(soldeTIC) >= 100)
                {
                    CheckBox chkSelect = null;
                    if (gridViewRow.FindControl("chkSelect") != null)
                    {  chkSelect = (CheckBox)gridViewRow.FindControl("chkSelect"); }
                    string argument = Tools.Getargument(db, domaineID);
                    argument = argument.Replace("\r", "");
                    argument = argument.Replace("\n", "");
                    fournisseurCode = fournisseurCode.Replace("\r", "");
                    fournisseurCode = fournisseurCode.Replace("\n", "");
                    if (fournisseurNom.Trim().Length > 40)
                    { fournisseurNom = fournisseurNom.Substring(0, 40);       }
                    fournisseurNom = fournisseurNom.Replace("\r", "");
                    fournisseurNom = fournisseurNom.Replace("\n", "");
                    domaineCode = domaineCode.Replace("\r", "");
                    domaineCode = domaineCode.Replace("\n", "");
                    if (domaineDescr.Trim().Length > 40)
                    {  domaineDescr = domaineDescr.Substring(0, 40);}
                    domaineDescr = domaineDescr.Replace("\r", "");
                    domaineDescr = domaineDescr.Replace("\n", "");
                    html.Append("<div class=\"panel-body\">");
                    html.Append("<div class=\"form-horizontal\">");
                    html.Append("<div class=\"form-group\">");
                    html.Append("<span class=\"control-label col-sm-2\">fournisseur :</span>");
                    html.Append("<div class=\"col-sm-10\">");
                    html.AppendFormat("<input type=\"text\" class=\"form-control\" readonly value=\"{0} - {1}\" />", Server.HtmlEncode(fournisseurCode), Server.HtmlEncode(fournisseurNom));
                    html.Append("</div>");
                    html.Append("</div>");
                    html.Append("<div class=\"form-group\">");
                    html.Append("<span class=\"control-label col-sm-2\">domaine :</span>");
                    html.Append("<div class=\"col-sm-10\">");
                    html.AppendFormat("<input type=\"text\" class=\"form-control\" readonly value=\"{0} - {1}\" />", Server.HtmlEncode(domaineCode), Server.HtmlEncode(domaineDescr));
                    html.Append("</div>");
                    html.Append("</div>");
                    html.Append("<div class=\"form-group\">");
                    html.Append("<span class=\"control-label col-sm-2\">Solde TIC :</span>");
                    html.Append("<div class=\"col-sm-5\">");
                    html.AppendFormat("<input type=\"text\" class=\"form-control text-right\" readonly value=\"{0}\" />", Server.HtmlEncode(soldeTIC));
                    html.Append("</div>");
                    html.Append("</div>");
                    html.Append("<div id=\"divargument\" class=\"form-group\">");
                    html.Append("<div class=\"col-sm-12\">");
                    html.Append("<textarea id=\"argument\" class=\"form-control\" rows=\"6\" placeholder=\"Une argument est requise pour les honoraires de $100 et plus.\">");
                    html.Append(Server.HtmlEncode(argument));
                    html.Append("</textarea>");
                    html.Append("</div>");
                    html.Append("</div>");
                    html.Append("</div>");
                    html.Append("</div>");
    
                    javascript.Length = 0;
                    javascript.Append("BootstrapDialog.show({");
                    javascript.Append("    title: 'argument',");
                    javascript.AppendFormat("    message: '{0}',", html.ToString());
                    javascript.Append("    closable: false,");
                    javascript.Append("    type: 'type-primary',");
                    javascript.Append("    data: {");
                    javascript.AppendFormat("        'domaineID' : '{0}'", domaineID);
                    javascript.Append("    },");
                    javascript.Append("    buttons: [{"); // bouton non fonctionnel                 javascript.Append("        label: 'OK',");
                    javascript.Append("        cssClass: 'btn btn-primary btn-100',");
                    javascript.Append("        action: function (dialogRef) {");
                    javascript.Append("    	       var argument = dialogRef.getModalBody().find('textarea').val();");
                    javascript.Append("    	       if ($.trim(argument).length == 0) {");
                    javascript.Append("                $('#divargument').addClass('has-error');");
                    javascript.Append("            }");
                    javascript.Append("            else {");
                    javascript.Append("               var actions = new Services.Actions();"); // service non reconnu - undefine                 javascript.Append("                actions.Setargument(");
                    javascript.Append("                    { \"domaineID\": \"'" + domaineID.ToString() + "'\", \"Description\": argument  },");
                    javascript.Append("                    null,");
                    javascript.Append("                    null,");
                    javascript.Append("                    null);");
                    javascript.Append("                dialogRef.close();");
                    javascript.Append("            }");
                    javascript.Append("        }");
                    javascript.Append("    }, {");
                    javascript.Append("        label: 'Annuler',");
                    javascript.Append("        cssClass: 'btn btn-primary btn-100',");
                    javascript.Append("        action: function (dialogRef) {");
                    javascript.Append("            dialogRef.close();");
                    if (argument.Trim().Length == 0)
                    { javascript.AppendFormat("      $('#{0}').attr('checked', false);", chkSelect.fournisseurID); }
                    javascript.Append("        }");
                    javascript.Append("    }]");
                    javascript.Append("});");
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Message", javascript.ToString(), true);
                }
            }
    • Partager sur Facebook
    • Partager sur Twitter

    Failed to load resource: the server responded with

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown