title: Debug CSHTML Page .Net Core 2.1
body: <p>I come from a .net Websites world but now I'm using .Net Core. I'm trying to find debug this code in a CSHTML file but you can't add a breakpoint? I'm using VS 2019 and trying to see more about this button which is here:</p>
  <pre><code>&lt;div class=&quot;shiptype-ship&quot; style=&quot;display: none;&quot;&gt;
      &lt;button id=&quot;btnNext_Ship&quot; class=&quot;btn btn-primary&quot; disabled=&quot;disabled&quot;&gt;Ready for Accounting Approval&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  <p>and it works down on this JS code in the CSHTML page:</p>
  <pre><code>   btnNext_Ship.on('click', async function () {
          divLoadingOverlay.show();
          PopulateMessage(divMessage, null, null);
  
          const uploadedPhotoCount = divImages.find('img').length;
          const isUseCustomerAccount = chkUseCustomerAccount.prop('checked');
          const customerAccountInfo = txtCustomerAccountInfo.val().trim();
          let shippingCost_Total = 0;
          let isValidInputs = true;
  
          if (isShipType_Partial) {
              const minImageCount = tblSalesOrderItems.find(`tbody tr td[name=&quot;tdSerialNos&quot;] ul li[data-salesordershipmentdeliveryid=&quot;${salesOrderShipmentDelivery.Id}&quot;]`).closest('tr').length;
  
              if (minImageCount === 0) {
                  PopulateMessage(divMessage, 'Items must be verified first.', 'error');
                  isValidInputs = false;
              }
              else if (isRequirePhotos &amp;&amp; uploadedPhotoCount &lt; minImageCount) {
                  PopulateMessage(divMessage, 'Verified item must have at least 1 photo.', 'error');
                  isValidInputs = false;
              }
              else if (isShipType_Ship &amp;&amp; tblSalesOrderPallets.find('tr[data-isverifyitemsincomplete=&quot;true&quot;]').length &gt; 0) {
                  PopulateMessage(divMessage, 'To deliver a pallet, all items in it must be verified.', 'error');
                  isValidInputs = false;
              }
          }
          else {
              const minPhotoCount = tblSalesOrderItems.find('tbody tr').length;
              const salesOrderItemRows = tblSalesOrderItems.find('tbody tr');
              let allItemsVerified = true;
  
              for (let i = 0; i &lt; salesOrderItemRows.length; i++) {
                  const $row = $(salesOrderItemRows[i]);
  
                  if (parseInt($row.attr('data-quantityverified')) &lt; parseInt($row.find('td[name=&quot;tdQuantity_Picked&quot;]').text())) {
                      allItemsVerified = false;
                      break;
                  }
              }
  
              if (!allItemsVerified) {
                  PopulateMessage(divMessage, 'Each item must be verified.', 'error');
                  isValidInputs = false;
              }
              else if (isRequirePhotos &amp;&amp; uploadedPhotoCount &lt; minPhotoCount) {
                  PopulateMessage(divMessage, 'Verified item must have at least 1 photo.', 'error');
                  isValidInputs = false;
              }
          }
  
          if (isValidInputs) {
              if (isUseCustomerAccount) {
                  if (customerAccountInfo.length === 0) {
                      PopulateMessage(divMessage, 'Customer Account Info is required.', 'error');
                      isValidInputs = false;
                  }
              }
              else {
                  shippingCost_Total = parseFloat(tblSalesOrderPallets.find('tfoot tr td input[name=&quot;txtShippingCost_Total&quot;]').val()) || 0;
  
                  if (shippingCost_Total &lt;= 0) {
                      PopulateMessage(divMessage, 'Cost per pallet or Total Cost is required.', 'error');
                      isValidInputs = false;
                  }
              }
          }
  
          if (isValidInputs) {
              const params = new URLSearchParams({
                  salesOrderShipmentId: salesOrderShipment.Id
              });
  
              const result = await fetch(`${api}LastWriteBackOn&amp;${params}`, { credentials: 'same-origin' })
                  .then(response =&gt; {
                      if (response.ok === false) {
                          throw response;
                      }
  
                      return response.json();
                  })
                  .catch(response =&gt; {
                      PopulateMessage(divMessage, response.statusText || response.message, 'error');
                  });
  
              if (result) {
                  if (result.MessageType === 'success') {
                      if (result.LastWriteBackOn === null) {
                          divStarShipNotification.attr('data-customeraccountinfo', customerAccountInfo);
                          divStarShipNotification.attr('data-shippingcosttotal', shippingCost_Total);
                          divStarShipNotification.modal('show');
                      }
                      else {
                          await SendToAccounting_ShipType_Ship(customerAccountInfo, shippingCost_Total);
                      }
                  }
                  else {
                      PopulateMessage(divMessage, result.Message, result.MessageType);
                  }
              }
          }
  
          divLoadingOverlay.hide();
      });
  </code></pre>
  <p>Thing is, I don't see &quot;btnNext_Ship&quot; in the code behind page and can't debug the cshtml page to test the JS code or how it connects to the code behind? Trying to locate a select for billing routine that's tied to this or see how it connects to this but just unable to connect the dots. Is there a way to do it? I'm looking on the web or in here and not seeing anything in relation to this? In a new job and the previous guy left before I was even hired so I'm flying solo.</p>
  <p>Thanks!</p>