class to access controls on webpage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I have a simple C# web application with only 1 form and about 20 controls
on it. I have a large section that enables all of the controls and makes
them visible based on screen inputs. I moved this section of code into a
class called Utility, control.enable = true, control1.visible=true and so on.
In order to get visibility of the control members in the Utility class I set
it up where the Utility class is derived from the Webform1 class, so in the
Utility class file I have
class Utility : Webform1 //derrived from webform one.
The problem is that in the main webform when I create an instance called
useutil of the Util class (Utility useutil = new Utility()), I get into a
loop since it starts to run the webform1 code over again(like a recursive
function). Anyhow just wondering if anyone has any suggestions, thanks.
 
Shouldn't WebForm1 inherit Utility instead of utility inheriting webform1???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top