Skip to main content

JQUERY Data table model become Null while posting Data to controller in MVC 5

Problem: JQUERY Data table model become Null while posting Data to controller in MVC 5.

Solutions: Use FOR LOOP instead of FOREACH loop to bind model for each table row.


 @for(var i = 0;i < Model.People.Count;i++)
{
   
        @Html.TextBoxFor(m => Model.People[i].Name)
        @Html.TextBoxFor(m => Model.People[i].Age)
   
}

       

Popular posts from this blog

Test Azure AD secured API with Postman

API deployed on Azure and secured by Azure AD. For example, we will create a simple Azure Function that returns weather data.  public static async Task Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { log.LogInformation("C# HTTP trigger function processed a request."); try { HttpResponseMessage response; AuthenticationContext authenticationContext = new AuthenticationContext("https://login.microsoftonline.com/xxxxxxxxx"); ClientCredential clientCredential = new ClientCredential("xxxxx-xxxxx", "xxxxxx"); AuthenticationResult authenticationResult = authenticationContext.AcquireTokenAsync("xxxx-xxxxx-xxxxx", clientCredential).Result; using (var httpClient = new HttpClient()) ...

Exploring the Factory Method Pattern: A Fundamental

Introduction : In the world of software development, design patterns are like building blocks that help us create well-structured and maintainable code. One such cornerstone is the Factory Method Pattern. In this blog post, we'll dive into the depths of the Factory Method Pattern, exploring its concepts, benefits, and real-world applications using C#. By the end, you'll have a solid understanding of this fundamental #DesignPattern and how to wield it effectively. Understanding the Factory Method Pattern The Factory Method Pattern falls under the category of creational design patterns. Its main purpose is to provide an interface for creating objects while allowing subclasses to alter the type of objects that will be created. This abstracts the process of object creation, promoting loose coupling between client code and the classes being instantiated. Key Components Product: This is the abstract class or interface that defines the type of object the Factory Method creates. Concre...

Get Documents Signed Using Adobe Sign API in C#

Electronic signatures have revolutionized the way businesses handle document workflows. Instead of dealing with cumbersome paper-based processes, electronic signatures offer a streamlined and efficient way to obtain legally binding signatures. Adobe Sign API takes this concept to the next level by providing developers with the tools to seamlessly integrate electronic signature capabilities into their applications. In this blog post, we will explore how to use the Adobe Sign API to send documents for signature via email using C#   Understanding Electronic Signatures and Adobe Sign API Electronic signatures, also known as e-signatures, are digital representations of a person's intent to agree to the content of a document. They hold the same legal weight as traditional ink signatures but offer the advantage of speed and convenience. Adobe Sign API allows developers to programmatically incorporate e-signatures into their applications, automating the signature process and enhancing the ...