I want to load the content from one page into a modal on another page on the click of a button, but it is also loading in the content from the __Layout page. I have tried calling a controller using: However, I cannot get it to load in solely what is in the MyPage.cshtml file. What am I doing wrong?
Tag: asp.net-mvc
JS not firing at all
I cannot get my button to trigger the javascript. This seems to be quite straightforward? What is keeping the alert from showing up? Answer You should end of the script tag if you add source only. And you should add extra script tag for internal script. And input type should be button because you are not submitting a form in
Is it possible to calculate a Bing Maps Route in C#, and then pass it to a Map in Javascript using MvC?
I am developing a Web Based Navigation app using Bing Maps and ASP MvC, and I found as well as being able to create a route in the view using JavaScript, it is possible to create a route in the C# controller using the Bing Maps Rest Toolkit, and then pass it over. However, I have been unable to find
Export to PDF error using Dot Net Report Builder
I am using the MVC version of the Dot Net Report Builder. I am able to configure dotnetreport and run a test report, but if I click on Export to PDF I get a javascript error – unexpected token export. Looking at the javascript console error it seems to be originating from bootstrap/popper. Answer Thanks for pointing this out, this
Show or Hide Field on MVC form base on the value of Viewbag using JavaScript
I am trying to Hide or Show filed on the MVC form base of a value stored in the Viewbag. the value of the Viewbag is a database return. I can see the value of the Viewbag in my JavaScript but when I run the form Hide/Show functionality is not working. I am missing something can anyone help CHTML code
GUID model binding in ASP.NET MVC
I was hoping someone could help me sort this out. The solution to this is probably obvious but I can’t seem to figure out what I’m missing… I’m trying to issue a get request from my Javascript code, and the URL contains a Guid. The ASP.NET controller does not get hit/register the request to the API. I’ve tried a couple
Prevent my website from running in Internet Explorer
I don’t want anyone to run my website in Internet Explorer, so I have added the following JavaScript call at the very beginning of the first .js file in my website, the file name is screen.js screen.js I have the following .js files in my bundle (ASP.NET MVC syntax): The above code runs fine in Chrome but IE does not
Prevent string to become number in javascript
I have a string 100-10-0 in my MVC model. I have to pass this string to a javascript function on an HTML button click. My code is: @Model.BarCode has the value “100-10-0”. My javascript function is: Problem here is that when barcode comes to javascript method as parameter it is converted to number and the minus operator is applied on
Mdbootstrap V5 input borders don’t appear when used in AngularJS pages (other than layout)
I’m trying to redesign some of the forms in an AngularJS application using mdbootstrap version 5. I’ve encountered a problem with inputs. The inputs that are inside pages of the dashboard (the app is a dashboard) don’t get borders, whereas inputs that are on the main page or layout do. I added the mdb.js file in my layout and it
Call Javascript function on click of dynamic tab
I am new to MVC and I have not written a lot of jQuery/JavaScript. I am trying to call a JavaScript function on click of a nav-tab. The nav-tabs are added to the page dynamically. I know the “name” of the specific tab which I need to call the function when clicked, but for the life of me, I cannot