1
Answer

Using separate class to handle events of Web user controls

Photo of JM Gonzalez

JM Gonzalez

20y
2.4k
1
Good day. I have this scenario wherein I have a number of 'Web user controls' to be placed on C# web forms. These controls are reused which means that they are placed on the forms of our web application, depending on the user. I want to keep all of the forms' events in a single separate class called "Events.cs". In summary, these is how it goes: 1. The user chooses which controls to be included in the form. 2. Upon raising an event for a user control (clicking a button), the control will raise an event listed on the separate class (Events.cs). 3. The events class will be the one to access the main form (where the user controls are placed); and do the necessary changes to the form and perform commands like database access. Is this possible? What is the best approach in doing this?

Answers (1)

0
Photo of Suthish Nair
NA 31.7k 4.6m 14y
query got resolved?
0
Photo of Sam Hobbs
NA 28.7k 1.3m 14y

Questions about ASP applications are supposed to be put in the ASP forum. If this is not for an ASP application then are you sure it is a datagrid ?
 
Oh, now I see; you have a space between datagrid and view. Is this for a DataGridView control in a desktop application? Is the control bound to the data?
0
Photo of Suthish Nair
NA 31.7k 4.6m 14y