Count Html Form Inputs With Name Prefix From Asp.net Code Behind
I've been searching for a while for something similar with no luck. This is what I have:
Solution 1:
var categoryInputKeys = Request.Form.AllKeys.Where(x=> x.StartsWith("category_")).ToList();
after fetching keys you can use them with like that
Request.Form[categoryInputKeys[0]]
Edit: For just counting them that will be enough;
var categoryInputCount = Request.Form.AllKeys.Where(x=>x.StartsWith("category_")).ToList().Count;
Post a Comment for "Count Html Form Inputs With Name Prefix From Asp.net Code Behind"