I’m using a Select tag and I have foreach that adds the values to the list, but I have to call an Update Controller and pass it 2 parameters using ActionLink. I tried to do it this way but it doesn’t work. I wanted to know what I’m doing wrong? The query should be something like this http://localhost:60082/Update?subSectionID=27&subsectionName=Something Thank you!
Tag: razor
Cannot Move Divs in Blazor
I have a Blazor Server App with the following DIV tags I attempted to set the Height, Width, and X/Y coordinates using the code samples from this page – https://blazor.tips/blazor-how-to-ready-window-dimensions/ but that never worked and simply threw an uncaught exception no matter where I placed Try… blocks. I then moved to a more straightforward JS call: If I make this
Razor Communicate Display of Modal from PageModel’s OnPost() Method
I want to communicate from my Razor PageModel’s OnPost() method to display the modal upon validation errors for it. Which basically means changing the modal’s css from display none to block. Is there a way for this to be done? Currently on return Page() the modal is hidden because thats what its css is initially set to, and is normally
JQuery validate dynamically added input fields against other dynamically added input fields
I have multiple pairs of input fields for start and end dates: I’m using jQuery’s validator.AddMethod to validate that the end date is after the starting date: The problem is the validation is always comparing the end dates to the first starting date. I want each end date to be compared to it’s relevant starting date. I’m still a newbie
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
Values are null when POSTing to Razor Handler via JavaScript fetch()
I’m trying to POST email content to a Razor Handler, but the request values don’t seem to be properly binding. I’ve been scouring all I can (including many questions on SO) for answers without luck. The code sends the data properly as best I can tell from the Network tab. My breakpoint in the handler is hit, but the request
JQuery not working with same name of multiple elements
In Razor View of I have written the html code for table Now Let’s say when click the button Add Custom Activity I need to alert the value of respective @item.orderID there might be a multiple row in the table and each row contains the button. My JQuery Code is : I works fine but the problem is the it
jQuery to pass data in Ajax call to MVC action method
I have two lists (list-left and list-right) prepared and populate. Then I have this JS code to move elements from one list to another. And it works fine. But honestly I don’t know how to pass the result back to codebehind when user clicks the submit button on the form? This is my cshtml code: And my controller: The [HttpPost]
Looping an SQL statement on razor
Attempted to create a ‘cart’ which holds selected items by the user but upon form completion, all the data from the ‘cart’ is inserted into one row Example: How do I separate the data into a row each? Intended Result: How it works: The user will click a button that will generate the following HTML codes. (Javascript) The input named
Razor MVC Populating Javascript array with Model Array
I’m trying to load a JavaScript array with an array from my model. Its seems to me that this should be possible. Neither of the below ways work. Cannot create a JavaScript loop and increment through Model Array with JavaScript variable Cannot create a Razor loop, JavaScript is out of scope I can get it to work with But I