ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to submit an empty lookup?
Title:
B
I
{code}
?
I have a form which a lookup is part of it. Sometimes I want to leave the input field in the lookup empty and submit the form(it means I dont want to pick any value from the lookup) but my lookup always raises the class input-validation-error whenever I did that. How can I submit an empty lookup?
Save Changes
Cancel
CuLacGionTan
asked at 15 Jul 2015
don't put [Required] on its viewmodel property, or if the type is int/long make it int? or long? (make it nullable), value types always need to have value
at 15 Jul 2015
Omu
Thanks you, it works now. I've been using Awesome grid for a while but I'm still not clear about the use of Key = "Id". When should I use it and where the value of Id come from?
at 16 Jul 2015
CuLacGionTan
the key is needed most of the time (when using EF, grid api, nesting), so just set it all the time, the value of the Id comes from the grid model, GridModelBuilder<Model> originally and if you're using Map, the result type from the Map function
at 16 Jul 2015
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK