473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

class to access controls on webpage

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.

--
Paul G
Software engineer.
Mar 14 '06 #1
1 1659
Shouldn't WebForm1 inherit Utility instead of utility inheriting webform1???

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
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.

--
Paul G
Software engineer.

Mar 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kristoffer | last post by:
Hi! I have a general db class (a normal class, that contains the functions and subs to enable me to connect to my database) ok... but, HOW?? Do, I make use of this class in my asp.net...
1
by: Dhiman | last post by:
Here is the problem. I have a parant class where I have declared couple of variables for user control that I will be using in the web pages. (ParentPage.vb) This class is inherited by the code...
2
by: Axel Dahmen | last post by:
Hi, a few weeks ago I had started a thread "Can't dynamically add controls because of <%...%> code blocks". The error mentioned keeps me from inserting an automatically generated navigation menu...
17
by: Joe | last post by:
Hello All; I can't access System.Web.HttpServerUtility from within a Class. I want to have access to MapPath. What I get are three options. They are: AspNetHostingPermission...
3
by: jonathan.beckett | last post by:
I have been experimenting with placing user controls (using Windows Forms controls) into an ASP.NET webpage - and am completely stuck. I can get a blank user control to work, but nothing beyond...
6
by: =?Utf-8?B?Y2hpZWtv?= | last post by:
Hello, I'd like to use a visual basic class.function to iterate through the html controls and verify that the user entered something in the controls. But I cannot figure out how to pass the...
3
by: Fred Chateau | last post by:
I am trying to access a user control class, for a user control that is loaded dynamically, from the containing page. I have been able to access Web controls in the user control, but so far I have...
3
by: Peter Oliphant | last post by:
It's not necessary, but it would be nice if there was a way I could easily create something like a 'web browser form' or a 'display web page form' as forms in my application (in a Panel would be...
7
by: Andy B | last post by:
I have a class I am creating for data access. I need to access controls from inside the class that are on a particular page. How do I do this? or is creating an instance of the page class and using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.