1

I want to generate html component in the server side of the asp.net mvc or controller.

My current approach: I want to generate one html table in the controller function, It will return html table code string. then i used the ajax call this controller function and get the return value. finish I use the jquery get the DIV object and innerHTML from controller return value to display table on DIV. if small data it will normal display.But I get the data is large data, IE will be forced to close and take up a lot of memory. So i would like use the server side handle it.

Do you have any way to deal with it?

1
  • 1
    Why are you doing server side table loading ? Well i will suggest you to use DataTable , JQGRid for tabular data with server side implementation.Only load server specific range data. Commented Oct 23, 2017 at 5:55

1 Answer 1

0

You should not load the full table except when explicitly needed. If the table is large, you will have problems with network latency and probably out of memory errors.

So, what you should do is limit what you take and return to the client. You can store the current position as a cookie, in a hidden input field or even in the session. The amount you want to load at a time is usually passed as a part of the request. Probably as a query parameter. You can limit it with server side validation, and return the max allowed if the user requests for too much at a time.

If you are using linq to retrieve the data, then you can use the Skip and Take methods to limit what you retrieve and retrieve from the current position.

Hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.