@HTML.TextBoxFor Performance inside Loop

101 views Asked by At

I am in a tough situation, help is highly appreciated.Long story short, I have a view showing around 45 columns(cant avoid) , which has around 500 or more records. This is showed inside a Partial View with 'FOR loop' with a condition. When the column has more than 1 record(make select list , check count [done in Controller]) then show DropdownList else show TextBoxFor. TextBoxFor is calling many Javascript functions - like marking it as Edited , showing tool tip , row highligting, making it as only Numeric TextBox etc. Performance as you would have gussed is really bad , when the records increase beyond 50. It takes 3 minutes to load and 5 minutes to save and reload the page. Using Entity framework for Data , with Lazy Loading, need to create Master/Detail Entities as I am receving Flat records from DB. Tried Performance Analysis from VS 2010 , couldnt attach screen shots as dont have enough points in this site. But I can see Number of calls to HTML.TextBoxFor over 1800 times... Is there any alternative to TextBoxFor which can call Custom Javascript functions

0

There are 0 answers