I returned a complete html when executing my ajax with specific url

0

When I run my ajax and send the location of my webmethod I get the following result:

<!DOCTYPE html>

<html lang="es">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>
    - NedERA
  </title>
  <script src="/Scripts/modernizr-2.8.3.js"></script>
  <link href="../Content/bootstrap.united.min.css" rel="stylesheet" />
  <link href="../Content/BootstrapXL.css" rel="stylesheet" />
  <link href="Content/v-636675292561384126/SiteTeachers.min.css" rel="stylesheet" />


  <link href="../Content/bootstrap-select.min.css" rel="stylesheet" />
  <link href="../Content/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
  <link href="../Content/NederaFont/style.css" rel="stylesheet" />

  <!-- Obtiene las rutas de los archivos .css -->
  <link rel="stylesheet" href="Content/v-636675292561227880/accordeon.css">
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
  <link href="Scripts/sliptree-bootstrap-tokenfield/css/bootstrap-tokenfield.min.css" rel="stylesheet" />
  <link href="Scripts/sliptree-bootstrap-tokenfield/css/tokenfield-typeahead.min.css" rel="stylesheet" />

</head>

<body>

  <div id="divSecurity" class="popup maxMin" style="z-index: 100;">
    <span id="PopUpSecurity">
    <div class="text-right">
        <a href="javascript:HidePopup('divSecurity');">
            <span><i class="fa fa-arrow-circle-left fa-2x"></i></span>
    </a>

  </div>
  <div class="row text-center">
    <h3>
      <span id="ctl12_LabTitle">Toma de Evidencia</span></h3>
  </div>
  <div class="space-small"></div>
  </span>
  <div class="row buttons">
    <div class="mainButton col-lg-offset-2 col-lg-3 col-xs-6 top-buffer">
      <span id="btnAddTutor">
    <div>
        <div class="panel panel-nedera panel-orange">
            <a href="TomaEvidencia.aspx">
                <div class="panel-heading text-center">
                    
                    <i class="fa fa-eye fa-5x"></i>
              
                    <div class="buttonstext">
                        <span id="ctl13_LabText" class="buttonstext"></span>
    </div>
  </div>
  </a>
  </div>
  </div>
  </span>
  </div>
  </div>
  </div>

Current code:

$.ajax({url: "LessonsPlans.aspx/validateInfo",
        dataType: "text",
        success: function(result){
            alert(result);
            return;
        },  
        error: function (xhr, status, error) {  
            alert(error);
        }
    });

WebMethod which is called by ajax :

[WebMethod]
public string validateInfo(){
    sendErrorOrSucces = "Error";
    return sendErrorOrSucces;
}

I should return the variable with the error I entered.

Viewing HTTP requests in google chrome

    
asked by David 20.07.2018 в 17:34
source

0 answers