title: Client side validation is working but passing Null values to the controller in MVC3?
body: <p><strong>Client side validation is not working...</strong>
  same process I have done in another page its working but there have not used forloop.
  Here when I type the text without doing the validation simply tick image is displaying... give me solution..</p>
  
  <p>View is</p>
  
  <pre><code> @model IList&lt;clientval.Models.ShoppingClass&gt;
   @using (Html.BeginForm("Login", "Home"))
          {
              for (int i =0; i &lt;1; i++)
              {
  
  
          &lt;table&gt;
          &lt;tr&gt;
          &lt;td&gt;@Html.Label("FirstName")&lt;/td&gt;
          &lt;td&gt;@Html.TextBox("FirstName")&lt;div&gt;@Html.ValidationMessageFor(o =&gt; o[i].FirstName)&lt;/div&gt;&lt;/td&gt;
          &lt;td&gt;@Html.Label("LastName")&lt;/td&gt;
          &lt;td&gt;@Html.TextBox("LastName")&lt;div&gt;@Html.ValidationMessageFor(o =&gt; o[i].LastName)&lt;/div&gt;&lt;/td&gt;
          &lt;tr&gt;
          }
          }
  </code></pre>
  
  <p>Script is</p>
  
  <pre><code>&lt;script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="../../assets/js/ClientScript.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Controller is</p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
   public ActionResult Guestlogin(string firstname, string lastname)
          {
  
                ShoppingClass s = new ShoppingClass();
                var button = Request["button"];
                var ob = s.Newcustomer(customerfirstname, customerlastname);
               TempData["BN"] = ob;
              return RedirectToAction("Sucessfully", ob);
  
          }
  </code></pre>
  
  <p>Model is </p>
  
  <pre><code>    [Required(ErrorMessage = "First Name is Required")]
      [RegularExpression(@"^[a-zA-Z ]*$", ErrorMessage = "First Name is Not valid")]
      public string FirstName { get; set; }
  
      [Required(ErrorMessage = "Last Name is Required")]
      [RegularExpression(@"^[a-zA-Z ]*$", ErrorMessage = "Last Name is Not valid")]
      public string LastName { get; set; }
      public List&lt;ShoppingClass&gt; Newcustomer(string firstname, string lastname)
          {
  
              List&lt;ShoppingClass&gt; list = new List&lt;ShoppingClass&gt;();
              ShoppingClass obj = new ShoppingClass();
  .
  .
  .
              }
  </code></pre>