This question is locked. New answers and comments are not allowed.
Hey all.
So I know why I'm getting this error: because I'm using ComboBox (not ComboBoxFor), hence no binding and i'm NOT including the .Name("uniqName") method.
So, the InvalidOperationException is a valid one. The problem is, when I do Include the .Name method, JQuery validation no longer works. I had to remove .Name from ComboBoxFor's through-out my application to get this to work, but they are OK because they have model binding and hence get an id/name attribute in mark-up.
I've even tried HtmlAttribute(new {@id = "uniqName"}), same for new { name = "uniqName"}. Tried all 4 (HiddenInput, Input, DropDownHtmlAttribute etc ...
Any help here on how to add the name Attribute, or why using it breaks JQuery validation would rock.
Thanks!
So I know why I'm getting this error: because I'm using ComboBox (not ComboBoxFor), hence no binding and i'm NOT including the .Name("uniqName") method.
So, the InvalidOperationException is a valid one. The problem is, when I do Include the .Name method, JQuery validation no longer works. I had to remove .Name from ComboBoxFor's through-out my application to get this to work, but they are OK because they have model binding and hence get an id/name attribute in mark-up.
I've even tried HtmlAttribute(new {@id = "uniqName"}), same for new { name = "uniqName"}. Tried all 4 (HiddenInput, Input, DropDownHtmlAttribute etc ...
Any help here on how to add the name Attribute, or why using it breaks JQuery validation would rock.
Thanks!