I’ve been receiving help with a program I’ve been working on from you guys (and I really appreciate it as I’m fairly new to ASP.NET), but now I’m stuck again.
I’ve got my List<Products> that contains one Product object with 17 properties(representing the fields). Some of these properties may be null(well actually, I already coded it so that if the field in the database was null, convert the properties to either “” or -1).
Is there any way to only create fields for the properties that aren’t null in my Details View using ASP.NET/C# or do I have to use Javascript or something else? I can provide what I have thus far if necessary.
In Your product class make all properties Nullable
like
int? productIdso it will not bind when it’s value is null
http://msdn.microsoft.com/en-us/library/2cf62fcy%28v=vs.80%29.aspx