I have a scenario in which I want to calculate the number of entries in a repeater that is in a user control and display the count in a literal that is on the page (ex default.aspx). How can i achieve this? I do not want to use public properties .... I want to do this by creating my own custom event.
Any help or suggestion would be greatly appreciated.
Thank Sumit Arora
Create a property in the user control:
public int NumberOfRecords { get { return myRepeater.Items.Count; } }
Then in Page_Load:
countLabel.Text = string.Format("Number of records: {0}", myUserControl.NumberOfRecords);
Source: https://habr.com/ru/post/1754218/More articles:ActiveRecord :: StatementInvalid (Mysql :: Error: PROCEDURE db_name.proc_spName cannot return the result set in the specified context: - ruby | fooobar.comPkcs # 11 memory error - what could be common causes? - memory-leaksstd :: tr1 :: function :: target and co- / contravarity - c ++Is there anyway the conversion of a C # function to a sql server stored procedure? - c #HSM - cryptocurrencies - sessions - timeout - cryptographyCall python code from VSTO excel addin - pythonПрименить стиль из поля базы данных в WPF - wpfClose if there are no active threads, or if they are active, and then wait for completion and closing - multithreadingHow to find out all installed fonts on a user computer? - javascriptSetWindowsHookEx с WH_MOUSE_LL замедляет работу мыши в течение нескольких секунд - c#All Articles