Hi
I am not able to debug javascript in VS 2015.
Error: The breakpoint will not currently be hit. No executable code is associated with this line
Please help.
<asp:LinkButton ID="AddextLink" runat="server" CssClass="btn btn-secondary btn-rounded btn-icon" Width="50px" ToolTip="External Link"><i class="fas fa-external-link-alt"></i></asp:LinkButton>
<script type="text/javascript">
$("#AddextLink").click(function () {
var iframe = document.getElementById("frmDisplay");
var linkdyntext = getIframeSelectionText(iframe);
$("#txtLinkLine").val(linkdyntext);
$("#addExLnk_popup").dialog({
autoOpen: false,
modal: true,
hide: 'fade',
title: "Add External Link",
buttons: [
{
text: "Add",
click: function () {
AddExternalLinkfn();
}
},
{
text: "Close",
click: function () {
$(this).dialog("close");
}
}
],
close: function () {
$("#txtLinkLine").val('');
//$("#txtLinktext").val('');
}
});
$("#myMenu").hide();
$("#addExLnk_popup").dialog("open");
});
function AddExternalLinkfn() {
var fileUpload = $("#sFileUpload").get(0);
var files = fileUpload.files;
var flname = files.name;
var data = new FormData();
for (var i = 0; i < files.length; i++) {
data.append(files[i].name, files[i]);
}
$.ajax({
url: "UploadHandler.ashx",
type: "POST",
contentType: false,
processData: false,
data: data,
// dataType: "json",
success: function (result) {
//alert(result);
UploadOperation(result)
},
error: function (err) {
alert(err.statusText);
}
});
}
function UploadOperation(uploadedfilepath) {
var linkline = $("#txtLinkLine").val();
//var linktext = $("#txtLinktext").val();
var linktext = linkline.slice(0, 20);
//alert(linktext);
var newfilepath = uploadedfilepath;
//var urltest = document.getElementById("HiddenField1").value;
//urltest = urltest.replace(/\\/g, '?');
newfilepath = newfilepath.replace(/\\/g, '?');
var inodeid = document.getElementById("HiddenField1").value;
var variant = document.getElementById("HiddenField3").value;
var name = document.getElementById('Label2').textContent;
if (linkline != null) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Amm.aspx/AddExtLink",
data: "{'Linkline':'" + linkline + "','LinkName':'" + linktext + "','Linkpath':'" + newfilepath + "','IdE' : '" + inodeid + "','VC':'" + variant + "','bookname': '" + name + "','filename': '" + flname + "'}",
dataType: "json",
success: function (data) {
$("#addExLnk_popup").dialog("close");
alert("Link Added Successfully");
//location.reload();
},
error: function (result) {
alert("Error");
}
});
}
else {
alert("Please Select Text")
}
};
</script>