473,387 Members | 1,583 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,387 software developers and data experts.

what is best approach doing this?

Hey

ASP.NET 2.0

I'm about to create a UserControl for my web project, but I'm wondering if I
need to create 2 UserControls instead. Because these UserControls will be
very similar, the only difference between them will be that one of these
UserControls are containing a control (also being a UserControl, lets call
it "A"), which the other UserControl don't contain!

So I thought about creating 2 different UserControls... but I guess this
would be bad, because these 2 UserControls will have the same markup, except
one the UserControls have a control ("A", mention above) which the other
userControl don't have

Or I could instead create only 1 UserControl, have have some logic in it
which hide or show the control ("A"). In this way I could use only
UserControl and use some kind of logic to hide or show this extra control
("A")... I guess this approach is the best, but would like to know your
thought about this too?

Best Regards

Jeff
Oct 14 '06 #1
4 1273
I prefer the second approach because it is easy to make changes later at one
place instead of two.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:u2**************@TK2MSFTNGP05.phx.gbl...
Hey

ASP.NET 2.0

I'm about to create a UserControl for my web project, but I'm wondering if I
need to create 2 UserControls instead. Because these UserControls will be
very similar, the only difference between them will be that one of these
UserControls are containing a control (also being a UserControl, lets call
it "A"), which the other UserControl don't contain!

So I thought about creating 2 different UserControls... but I guess this
would be bad, because these 2 UserControls will have the same markup, except
one the UserControls have a control ("A", mention above) which the other
userControl don't have

Or I could instead create only 1 UserControl, have have some logic in it
which hide or show the control ("A"). In this way I could use only
UserControl and use some kind of logic to hide or show this extra control
("A")... I guess this approach is the best, but would like to know your
thought about this too?

Best Regards

Jeff
Oct 14 '06 #2
I agree on that but if I hide the control, will the UserControl display
still reserve space for the hided control?

In other words this control I want to hide/show is (400 pixels height and
witdth=100%) placed at the top of the UserControl. If this control is hidden
will the UserControl still reserve space (400 pixels height and witdth=100%)
for the hidden control??....

and in what event should I hide/show the control?

Jeff
"Siva M" <sh******@online.excite.comwrote in message
news:OR****************@TK2MSFTNGP02.phx.gbl...
>I prefer the second approach because it is easy to make changes later at
one
place instead of two.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:u2**************@TK2MSFTNGP05.phx.gbl...
Hey

ASP.NET 2.0

I'm about to create a UserControl for my web project, but I'm wondering if
I
need to create 2 UserControls instead. Because these UserControls will be
very similar, the only difference between them will be that one of these
UserControls are containing a control (also being a UserControl, lets call
it "A"), which the other UserControl don't contain!

So I thought about creating 2 different UserControls... but I guess this
would be bad, because these 2 UserControls will have the same markup,
except
one the UserControls have a control ("A", mention above) which the other
userControl don't have

Or I could instead create only 1 UserControl, have have some logic in it
which hide or show the control ("A"). In this way I could use only
UserControl and use some kind of logic to hide or show this extra control
("A")... I guess this approach is the best, but would like to know your
thought about this too?

Best Regards

Jeff


Oct 14 '06 #3
Set the Visible property to False. This wil not generate any markup nor will
it occupy any space on the browser.

Page Load event may be used to show/hide the control.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
I agree on that but if I hide the control, will the UserControl display
still reserve space for the hided control?

In other words this control I want to hide/show is (400 pixels height and
witdth=100%) placed at the top of the UserControl. If this control is hidden
will the UserControl still reserve space (400 pixels height and witdth=100%)
for the hidden control??....

and in what event should I hide/show the control?

Jeff
"Siva M" <sh******@online.excite.comwrote in message
news:OR****************@TK2MSFTNGP02.phx.gbl...
>I prefer the second approach because it is easy to make changes later at
one
place instead of two.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:u2**************@TK2MSFTNGP05.phx.gbl...
Hey

ASP.NET 2.0

I'm about to create a UserControl for my web project, but I'm wondering if
I
need to create 2 UserControls instead. Because these UserControls will be
very similar, the only difference between them will be that one of these
UserControls are containing a control (also being a UserControl, lets call
it "A"), which the other UserControl don't contain!

So I thought about creating 2 different UserControls... but I guess this
would be bad, because these 2 UserControls will have the same markup,
except
one the UserControls have a control ("A", mention above) which the other
userControl don't have

Or I could instead create only 1 UserControl, have have some logic in it
which hide or show the control ("A"). In this way I could use only
UserControl and use some kind of logic to hide or show this extra control
("A")... I guess this approach is the best, but would like to know your
thought about this too?

Best Regards

Jeff


Oct 14 '06 #4
Thanks!

"Siva M" <sh******@online.excite.comwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...
Set the Visible property to False. This wil not generate any markup nor
will
it occupy any space on the browser.

Page Load event may be used to show/hide the control.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
I agree on that but if I hide the control, will the UserControl display
still reserve space for the hided control?

In other words this control I want to hide/show is (400 pixels height and
witdth=100%) placed at the top of the UserControl. If this control is
hidden
will the UserControl still reserve space (400 pixels height and
witdth=100%)
for the hidden control??....

and in what event should I hide/show the control?

Jeff
"Siva M" <sh******@online.excite.comwrote in message
news:OR****************@TK2MSFTNGP02.phx.gbl...
>>I prefer the second approach because it is easy to make changes later at
one
place instead of two.

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:u2**************@TK2MSFTNGP05.phx.gbl...
Hey

ASP.NET 2.0

I'm about to create a UserControl for my web project, but I'm wondering
if
I
need to create 2 UserControls instead. Because these UserControls will be
very similar, the only difference between them will be that one of these
UserControls are containing a control (also being a UserControl, lets
call
it "A"), which the other UserControl don't contain!

So I thought about creating 2 different UserControls... but I guess this
would be bad, because these 2 UserControls will have the same markup,
except
one the UserControls have a control ("A", mention above) which the other
userControl don't have

Or I could instead create only 1 UserControl, have have some logic in it
which hide or show the control ("A"). In this way I could use only
UserControl and use some kind of logic to hide or show this extra control
("A")... I guess this approach is the best, but would like to know your
thought about this too?

Best Regards

Jeff



Oct 14 '06 #5

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

Similar topics

12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
6
by: Simon Says | last post by:
Hi all, I've a message object that is serialized to a xml string and communicating between a client and server with a connection-oriented (TCP) socket. Unlike a UDP, in a TCP socket, the...
8
by: Henrik | last post by:
Hi Is there any way to see what the System process is doing? We have developed an application running at a production site to measure and optimize the production. The application needs to be...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
184
by: jim | last post by:
In a thread about wrapping .Net applications using Thinstall and Xenocode, it was pointed out that there may be better programming languages/IDEs to use for the purpose of creating standalone,...
10
by: timor.super | last post by:
Hi all, Imagine I've an array of int : int anArray = new int; I want to extract all the integer that are superior to 500 I can do :
69
by: Yee.Chuang | last post by:
When I began to learn C, My teacher told me that pointer is the most difficult part of C, it makes me afraid of it. After finishing C program class, I found that all the code I wrote in C contains...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.