Note that there are some explanatory texts on larger screens.

plurals
  1. POComments on table, dynamic controls, C# and asp.net
    primarykey
    data
    text
    <p>Imagine a table and a button to add new rows to the table. On each click to the button, a new row will be inserted at the end of the table. The button event is functioning as follows: </p> <ul> <li>first of all, it points out a reference row to copy. </li> <li>whatever the controls and text are inside this referenced row they are copied to a datatable. Since a datatable cannot hold controls I am converting them to strings and saving them like that. </li> <li><p>At the end, the datatable is stored within a cache. </p></li> <li><p>Finally, on each page_init event I re-create the table using the data inside the datatable. Everything works fine.</p></li> </ul> <p>However, I'm curious. Since I have from 3 to 5 tables in the page and all of them are stored in a different cache with a different datatable, and all of them are re-created during the page-cycle events, may it cause any problems in the future? By the way, please note that once the user leaves the page the cache is deleted. </p> <p>I did not want to paste the whole code here since it's a bit long and may alienate people from reading the question. But I can give some statistics so that you can make some comments on it.</p> <p>The class I've written is 118 lines long. During the process of recreation of the table, there are 3 nested for/foreach loops, but they are not that long (the average loop times is probably from 5 to 10 for each). And finally, as mentioned above, to re-create the table a datatable that is saved in cache is used. </p> <p>So, I ask the question again: The code works perfectly, but I would like to know if building such a code is performance-friendly? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload