Hard to describe be here goes.
Currently I have this in the aspx page
<% = new BuildFormField() { FieldName = "FirstName" }%>
And the simplified object
Class BuildFormField(){
return GetFieldAttributes("FirstName") //calls a linq query based on the field name to get all the attributes of the field ie size/class and builds the html string.
}
The problem is, I will have many of these and it queries the database every time. What I would like to do is build a general dataset once and query that result set for each field.
I can't figure out where I should setup the initial query. Obviously don't want to put it in the aspx page or the controller and I can't figure out how to create a class that would only get called once that I could use again inside the BuildFormField Class.
Hope that makes sense. Yea, a bit unusual of a way to create form fields, but there is good reasons.
Thanks ahead of time.
View Complete Post